Skip to content

Commit 3115737

Browse files
authored
Merge branch 'main' into fix/memory-warnings
2 parents e764c62 + ab7a705 commit 3115737

File tree

11 files changed

+352
-158
lines changed

11 files changed

+352
-158
lines changed

.github/workflows/build-test-publish.yml

Lines changed: 29 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
branches: [ "main" ]
1414

1515
env:
16-
GO_VERSION: ~1.24
16+
GO_VERSION: 'stable'
1717
# Taken from https://github.com/kubernetes-sigs/kind/releases/tag/v0.18.0
1818
# The image here should be listed under 'Images built for this release' for the version of kind in go.mod
1919
KIND_NODE_IMAGE: "kindest/node:v1.32.0"
@@ -31,7 +31,7 @@ jobs:
3131
uses: actions/checkout@v5
3232

3333
- name: Install Go
34-
uses: actions/setup-go@v5
34+
uses: actions/setup-go@v6
3535
with:
3636
go-version: ${{ env.GO_VERSION }}
3737
check-latest: true
@@ -92,7 +92,7 @@ jobs:
9292
uses: actions/checkout@v5
9393

9494
- name: Install Go
95-
uses: actions/setup-go@v5
95+
uses: actions/setup-go@v6
9696
with:
9797
go-version: ${{ env.GO_VERSION }}
9898
check-latest: true
@@ -120,12 +120,14 @@ jobs:
120120
permissions:
121121
contents: 'write'
122122
id-token: 'write'
123+
packages: 'write'
123124
steps:
124125
- name: Checkout
125126
uses: actions/checkout@v5
126127

127128
- name: Install Go
128-
uses: actions/setup-go@v5
129+
id: set-go
130+
uses: actions/setup-go@v6
129131
with:
130132
go-version: ${{ env.GO_VERSION }}
131133
check-latest: true
@@ -138,6 +140,7 @@ jobs:
138140
images: |
139141
rabbitmqoperator/cluster-operator
140142
quay.io/rabbitmqoperator/cluster-operator
143+
ghcr.io/rabbitmq/cluster-operator
141144
# generate Docker tags based on the following events/attributes
142145
tags: |
143146
type=sha
@@ -151,20 +154,28 @@ jobs:
151154
uses: docker/setup-buildx-action@v3
152155

153156
- name: Login to Docker Hub
154-
if: github.event_name != 'pull_request'
157+
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }}
155158
uses: docker/login-action@v3
156159
with:
157160
username: ${{ secrets.DOCKERHUB_USERNAME }}
158161
password: ${{ secrets.DOCKERHUB_TOKEN }}
159162

160163
- name: Login to Quay.io
161-
if: github.event_name != 'pull_request'
164+
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }}
162165
uses: docker/login-action@v3
163166
with:
164167
registry: quay.io
165168
username: ${{ secrets.QUAY_USERNAME }}
166169
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
167170

171+
- name: Login to GHCR
172+
if: ${{ github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/v') }}
173+
uses: docker/login-action@v3
174+
with:
175+
registry: ghcr.io
176+
username: ${{ github.repository_owner }}
177+
password: ${{ secrets.GITHUB_TOKEN }}
178+
168179
- name: Build and push
169180
id: build
170181
uses: docker/build-push-action@v6
@@ -176,8 +187,13 @@ jobs:
176187
push: true
177188
tags: ${{ steps.meta.outputs.tags }}
178189
labels: ${{ steps.meta.outputs.labels }}
190+
# FIXME: mount cache in the container
191+
# https://github.com/reproducible-containers/buildkit-cache-dance
192+
# https://docs.docker.com/build/ci/github-actions/cache/#cache-mounts
179193
cache-from: type=gha
180194
cache-to: type=gha,mode=max
195+
build-args: |
196+
GO_TAG=${{ steps.set-go.outputs.go-version }}
181197
182198
- name: Build to TAR
183199
id: build_tar
@@ -207,8 +223,7 @@ jobs:
207223
pushd config/installation
208224
kustomize edit set image rabbitmqoperator/cluster-operator-dev=rabbitmqoperator/cluster-operator:"${RELEASE_VERSION}"
209225
popd
210-
make generate-installation-manifest QUAY_IO_OPERATOR_IMAGE=quay.io/rabbitmqoperator/cluster-operator:"${RELEASE_VERSION}"
211-
echo -n "cluster-operator-${{ steps.meta.outputs.version }}.yml" > "latest-cluster-operator-dev-manifest.txt"
226+
make generate-installation-manifest QUAY_IO_OPERATOR_IMAGE=quay.io/rabbitmqoperator/cluster-operator:"${RELEASE_VERSION}" GHCR_IO_OPERATOR_IMAGE=ghcr.io/rabbitmq/cluster-operator:"${RELEASE_VERSION}"
212227
213228
- name: Upload operator manifests
214229
uses: actions/upload-artifact@v4
@@ -227,13 +242,13 @@ jobs:
227242
rabbitmq-image:
228243
- rabbitmq:3.13.7-management
229244
- rabbitmq:management
230-
- pivotalrabbitmq/rabbitmq:main
245+
- pivotalrabbitmq/rabbitmq:main-otp27
231246
steps:
232247
- name: Check out code into the Go module directory
233248
uses: actions/checkout@v5
234249

235250
- name: Install Go
236-
uses: actions/setup-go@v5
251+
uses: actions/setup-go@v6
237252
with:
238253
go-version: ${{ env.GO_VERSION }}
239254
check-latest: true
@@ -303,7 +318,7 @@ jobs:
303318
uses: actions/checkout@v5
304319

305320
- name: Install Go
306-
uses: actions/setup-go@v5
321+
uses: actions/setup-go@v6
307322
with:
308323
go-version: ${{ env.GO_VERSION }}
309324
check-latest: true
@@ -359,7 +374,7 @@ jobs:
359374
uses: actions/checkout@v5
360375

361376
- name: Install Go
362-
uses: actions/setup-go@v5
377+
uses: actions/setup-go@v6
363378
with:
364379
go-version: ${{ env.GO_VERSION }}
365380
check-latest: true
@@ -418,7 +433,7 @@ jobs:
418433
uses: actions/checkout@v5
419434

420435
- name: Install Go
421-
uses: actions/setup-go@v5
436+
uses: actions/setup-go@v6
422437
with:
423438
go-version: ${{ env.GO_VERSION }}
424439
check-latest: true
@@ -491,6 +506,7 @@ jobs:
491506
files: |
492507
cluster-operator.yml
493508
cluster-operator-quay-io.yml
509+
cluster-operator-ghcr-io.yml
494510
generate_release_notes: true
495511
draft: true
496512
body_path: release-header.md

.github/workflows/codeql-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
uses: actions/checkout@v5
5050

5151
- name: Install Go
52-
uses: actions/setup-go@v5
52+
uses: actions/setup-go@v6
5353
with:
5454
go-version-file: go.mod
5555

.github/workflows/olm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ jobs:
109109
uses: actions/checkout@v5
110110

111111
- name: Install Go
112-
uses: actions/setup-go@v5
112+
uses: actions/setup-go@v6
113113
with:
114114
go-version-file: "go.mod"
115115
- name: Kubectl tool installer

.github/workflows/prometheus-rules.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
name: Checkout code
1515

1616
- name: Install Go
17-
uses: actions/setup-go@v5
17+
uses: actions/setup-go@v6
1818
with:
1919
go-version-file: "go.mod"
2020

.github/workflows/stale.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Close Stale Issues
12-
uses: actions/stale@v9
12+
uses: actions/stale@v10
1313
with:
1414
# Token for the repository. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`.
1515
repo-token: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
ARG GO_TAG=1.24
12
# Build the manager binary
2-
FROM --platform=$BUILDPLATFORM golang:1.24 AS builder
3+
FROM --platform=$BUILDPLATFORM golang:${GO_TAG} AS builder
34

45
WORKDIR /workspace
56

Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ unit-tests::vuln
6565
unit-tests::manifests
6666
unit-tests::just-unit-tests ## Run unit tests
6767

68+
GINKGO ?= go run github.com/onsi/ginkgo/v2/ginkgo
69+
6870
.PHONY: just-unit-tests
6971
just-unit-tests:
70-
ginkgo -r --randomize-all api/ internal/ pkg/
72+
$(GINKGO) -r --randomize-all api/ internal/ pkg/
7173

7274
.PHONY: integration-tests
7375
integration-tests::install-tools
@@ -81,7 +83,7 @@ integration-tests::just-integration-tests ## Run integration tests
8183

8284
.PHONY: just-integration-tests
8385
just-integration-tests:
84-
ginkgo -r controllers/
86+
$(GINKGO) -r controllers/
8587

8688
manifests: install-tools ## Generate manifests e.g. CRD, RBAC etc.
8789
controller-gen crd rbac:roleName=operator-role paths="./api/...;./controllers/..." output:crd:artifacts:config=config/crd/bases
@@ -191,11 +193,13 @@ $(YTT): | $(LOCAL_TESTBIN)
191193
chmod +x $(YTT)
192194

193195
QUAY_IO_OPERATOR_IMAGE ?= quay.io/rabbitmqoperator/cluster-operator:latest
196+
GHCR_IO_OPERATOR_IMAGE ?= ghcr.io/rabbitmq/cluster-operator:latest
194197
# Builds a single-file installation manifest to deploy the Operator
195198
generate-installation-manifest: | $(YTT)
196199
mkdir -p releases
197200
kustomize build config/installation/ > releases/cluster-operator.yml
198201
$(YTT) -f releases/cluster-operator.yml -f config/ytt/overlay-manager-image.yaml --data-value operator_image=$(QUAY_IO_OPERATOR_IMAGE) > releases/cluster-operator-quay-io.yml
202+
$(YTT) -f releases/cluster-operator.yml -f config/ytt/overlay-manager-image.yaml --data-value operator_image=$(GHCR_IO_OPERATOR_IMAGE) > releases/cluster-operator-ghcr-io.yml
199203

200204
docker-build: ## Build the docker image with tag `latest`
201205
@$(call check_defined, OPERATOR_IMAGE, path to the Operator image within the registry e.g. rabbitmq/cluster-operator)
@@ -232,7 +236,7 @@ cert-manager-rm:
232236
kubectl delete -f https://github.com/cert-manager/cert-manager/releases/download/v$(CERT_MANAGER_VERSION)/cert-manager.yaml --ignore-not-found
233237

234238
system-tests: install-tools ## Run end-to-end tests against Kubernetes cluster defined in ~/.kube/config
235-
NAMESPACE="$(SYSTEM_TEST_NAMESPACE)" K8S_OPERATOR_NAMESPACE="$(K8S_OPERATOR_NAMESPACE)" ginkgo -nodes=3 --randomize-all -r system_tests/
239+
NAMESPACE="$(SYSTEM_TEST_NAMESPACE)" K8S_OPERATOR_NAMESPACE="$(K8S_OPERATOR_NAMESPACE)" $(GINKGO) -nodes=3 --randomize-all -r system_tests/
236240

237241
kubectl-plugin-tests: ## Run kubectl-rabbitmq tests
238242
@echo "running kubectl plugin tests"

0 commit comments

Comments
 (0)