Skip to content

Commit 978755b

Browse files
committed
Skip Ci kind to use makefile kind cluster instead
Signed-off-by: jose.vazquez <jose.vazquez@mongodb.com>
1 parent 3dce482 commit 978755b

File tree

5 files changed

+31
-101
lines changed

5 files changed

+31
-101
lines changed

.github/workflows/test-e2e-gov.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,10 @@ jobs:
1414
uses: actions/checkout@v5
1515
with:
1616
submodules: true
17-
- name: Create k8s Kind Cluster
18-
if: ${{ !env.ACT }}
19-
uses: helm/kind-action@v1.13.0
20-
with:
21-
version: v0.29.0
22-
config: test/helper/e2e/config/kind.yaml
23-
cluster_name: "atlas-gov-e2e-test"
24-
wait: 180s
2517
- name: Install devbox
2618
uses: jetify-com/devbox-install-action@v0.14.0
2719
with:
2820
enable-cache: 'true'
29-
- name: Install CRDs
30-
run: devbox run -- 'make install'
3121
- name: Run e2e test
3222
env:
3323
MCLI_PUBLIC_API_KEY: ${{ secrets.ATLAS_GOV_PUBLIC_KEY }}
@@ -39,7 +29,8 @@ jobs:
3929
AWS_ACCOUNT_ARN_LIST: ${{ secrets.AWS_ACCOUNT_ARN_LIST }}
4030
PAGER_DUTY_SERVICE_KEY: ${{ secrets.PAGER_DUTY_SERVICE_KEY }}
4131
TEST_NAME: "atlas-gov"
42-
run: devbox run -- ./scripts/launch-ci-e2e.sh
32+
USE_NEXT_VERSION: "true"
33+
run: devbox run -- make e2e label=${{ env.TEST_NAME}}
4334
- name: Upload operator logs
4435
if: ${{ failure() }}
4536
uses: actions/upload-artifact@v5

.github/workflows/test-e2e.yml

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -133,33 +133,16 @@ jobs:
133133
run: |
134134
devbox run -- make bundle
135135
136-
137136
- name: Extract k8s version/platform
138137
id: extract
139138
run: |
140139
echo "k8s_version=$(echo '${{ matrix.k8s }}' | awk -F '-' '{print $1}')" >> $GITHUB_OUTPUT
141140
echo "k8s_platform=$(echo '${{ matrix.k8s }}' | awk -F '-' '{print $2}')" >> $GITHUB_OUTPUT
142141
143-
- name: Setup kind cluster
144-
if: ${{ steps.extract.outputs.k8s_platform == 'kind' }}
145-
uses: helm/kind-action@v1.13.0
146-
with:
147-
version: v0.29.0
148-
config: test/helper/e2e/config/kind.yaml
149-
node_image: kindest/node:${{ steps.extract.outputs.k8s_version }}
150-
cluster_name: ${{ matrix.test }}-${{ matrix.k8s }}
151-
wait: 180s
152-
153-
- name: Print Kubernetes version
154-
run: devbox run -- kubectl version
155-
156-
- name: Apply CRDs
157-
run: devbox run -- make install-crds
158-
159142
- name: Run CI E2E tests
160-
run: devbox run -- make e2e
143+
run: devbox run -- make e2e label=${{ env.TEST_NAME}}
161144
env:
162-
label: ${{ matrix.test }}
145+
TEST_NAME: ${{ matrix.test }}
163146
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
164147
AWS_ACCOUNT_ARN_LIST: ${{ secrets.AWS_ACCOUNT_ARN_LIST }}
165148
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -210,21 +193,8 @@ jobs:
210193
echo "k8s_version=$(echo '${{ matrix.k8s }}' | awk -F '-' '{print $1}')" >> $GITHUB_OUTPUT
211194
echo "k8s_platform=$(echo '${{ matrix.k8s }}' | awk -F '-' '{print $2}')" >> $GITHUB_OUTPUT
212195
213-
- name: Setup kind cluster
214-
if: ${{ steps.extract.outputs.k8s_platform == 'kind' }}
215-
uses: helm/kind-action@v1.13.0
216-
with:
217-
version: v0.29.0
218-
config: test/helper/e2e/config/kind.yaml
219-
node_image: kindest/node:${{ steps.extract.outputs.k8s_version }}
220-
cluster_name: ${{ matrix.test }}-${{ matrix.k8s }}
221-
wait: 180s
222-
223-
- name: Print Kubernetes version
224-
run: devbox run -- kubectl version
225-
226196
- name: Run CI helm-E2E test with prepared image
227-
run: devbox run -- ./scripts/launch-ci-e2e.sh
197+
run: devbox run -- make e2e label=${{ env.TEST_NAME }}
228198
env:
229199
TEST_NAME: ${{ matrix.test }}
230200
IMAGE_PULL_SECRET_REGISTRY: ghcr.io

.github/workflows/tests-e2e2.yaml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -150,37 +150,17 @@ jobs:
150150
echo "k8s_version=$version" >> $GITHUB_OUTPUT
151151
echo "k8s_platform=$platform" >> $GITHUB_OUTPUT
152152
153-
- name: Create k8s Kind Cluster
154-
if: ${{ steps.properties.outputs.k8s_platform == 'kind' && !env.ACT }}
155-
uses: helm/kind-action@v1.13.0
156-
with:
157-
version: v0.29.0
158-
config: test/helper/e2e/config/kind.yaml
159-
node_image: kindest/node:${{ steps.properties.outputs.k8s_version }}
160-
cluster_name: ${{ matrix.test }}
161-
wait: 180s
162-
163-
- name: Print kubectl version
164-
run: |
165-
devbox run -- 'kubectl version'
166-
167-
- name: Install CRDs if needed
168-
run: |
169-
devbox run -- 'make install-crds'
170-
devbox run -- 'make bundle'
171-
172153
- name: Run E2E2 test
173154
env:
174155
MCLI_PUBLIC_API_KEY: ${{ secrets.ATLAS_PUBLIC_KEY }}
175156
MCLI_PRIVATE_API_KEY: ${{ secrets.ATLAS_PRIVATE_KEY }}
176157
MCLI_ORG_ID: ${{ secrets.ATLAS_ORG_ID}}
177158
MCLI_OPS_MANAGER_URL: "https://cloud-qa.mongodb.com/"
178159
TEST_NAME: "${{ matrix.test }}"
179-
USE_KIND: false
160+
USE_CURRENT_VERSION: "true"
180161
run: |
181162
echo "Using ENV: ${{ steps.select-env.outputs.ENV }}"
182-
label=${TEST_NAME}
183-
devbox run -- make e2e2 label="${label}"
163+
devbox run -- make e2e2 label=${{ env.TEST_NAME }}
184164
185165
- name: Upload operator logs
186166
if: ${{ failure() }}

.github/workflows/tests-selectable.yaml

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -233,25 +233,8 @@ jobs:
233233
platform=$(echo ${{ matrix.k8s }} | awk -F "-" '{print $2}')
234234
echo "k8s_version=$version" >> $GITHUB_OUTPUT
235235
echo "k8s_platform=$platform" >> $GITHUB_OUTPUT
236-
- name: Create k8s Kind Cluster
237-
if: ${{ steps.properties.outputs.k8s_platform == 'kind' && !env.ACT }}
238-
uses: helm/kind-action@v1.13.0
239-
with:
240-
version: v0.29.0
241-
config: test/helper/e2e/config/kind.yaml
242-
node_image: kindest/node:${{ steps.properties.outputs.k8s_version }}
243-
cluster_name: ${{ matrix.test }}
244-
wait: 180s
245-
- name: Print kubectl version
246-
run: |
247-
devbox run -- 'kubectl version'
248-
- name: Install CRDs if needed
249-
if: ${{ !( matrix.test == 'helm-update' || matrix.test == 'helm-wide' || matrix.test == 'helm-ns' || matrix.test == 'bundle-test' ) }}
250-
run: |
251-
devbox run -- 'make install'
252236
- name: Run E2E test
253237
env:
254-
label: "${{ matrix.test }}"
255238
MCLI_OPS_MANAGER_URL: "https://cloud-qa.mongodb.com/"
256239
MCLI_ORG_ID: ${{ secrets.ATLAS_ORG_ID}}
257240
MCLI_PUBLIC_API_KEY: ${{ secrets.ATLAS_PUBLIC_KEY }}
@@ -260,6 +243,7 @@ jobs:
260243
IMAGE_PULL_SECRET_REGISTRY: ghcr.io
261244
IMAGE_PULL_SECRET_USERNAME: $
262245
IMAGE_PULL_SECRET_PASSWORD: "${{ secrets.GITHUB_TOKEN }}"
246+
TEST_NAME: "${{ matrix.test }}"
263247
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
264248
AWS_ACCOUNT_ARN_LIST: ${{ secrets.AWS_ACCOUNT_ARN_LIST }}
265249
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -272,7 +256,7 @@ jobs:
272256
PAGER_DUTY_SERVICE_KEY: ${{ secrets.PAGER_DUTY_SERVICE_KEY }}
273257
run: |
274258
echo "Using ENV: ${{ steps.select-env.outputs.ENV }}"
275-
devbox run -- make e2e
259+
devbox run -- make e2e label=${{ env.TEST_NAME }}
276260
- name: Upload operator logs
277261
if: ${{ failure() }}
278262
uses: actions/upload-artifact@v5
@@ -304,20 +288,10 @@ jobs:
304288
ref: ${{github.event.pull_request.head.sha}}
305289
submodules: true
306290
fetch-depth: 0
307-
- name: Create k8s Kind Cluster
308-
if: ${{ !env.ACT }}
309-
uses: helm/kind-action@v1.13.0
310-
with:
311-
version: v0.29.0
312-
config: test/helper/e2e/config/kind.yaml
313-
cluster_name: "atlas-gov-e2e-test"
314-
wait: 180s
315291
- name: Install devbox
316292
uses: jetify-com/devbox-install-action@v0.14.0
317293
with:
318294
enable-cache: 'true'
319-
- name: Install CRDs
320-
run: devbox run -- 'make install'
321295
- name: Run e2e test
322296
env:
323297
MCLI_PUBLIC_API_KEY: ${{ secrets.ATLAS_GOV_PUBLIC_KEY }}
@@ -329,7 +303,7 @@ jobs:
329303
AWS_ACCOUNT_ARN_LIST: ${{ secrets.AWS_ACCOUNT_ARN_LIST }}
330304
PAGER_DUTY_SERVICE_KEY: ${{ secrets.PAGER_DUTY_SERVICE_KEY }}
331305
TEST_NAME: "${{ matrix.test }}"
332-
run: devbox run -- ./scripts/launch-ci-e2e.sh
306+
run: devbox run -- make e2e label=${{ env.TEST_NAME }}
333307
- name: Upload operator logs
334308
if: ${{ failure() }}
335309
uses: actions/upload-artifact@v5

Makefile

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ VERSION ?= $(shell git describe --always --tags --dirty --broken | cut -c 2-)
2323
BUILDTIME ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
2424
GITCOMMIT ?= $(shell git rev-parse --short HEAD 2> /dev/null || true)
2525

26+
# Fix for e2e-gov tests not to use a bad semver version instead
27+
ifdef USE_NEXT_VERSION
28+
VERSION=$(NEXT_VERSION)
29+
endif
30+
31+
# Fix for e2e2 all-in-one test so that it uses an image that already exists in pre-release
32+
ifdef USE_CURRENT_VERSION
33+
VERSION=$(CURRENT_VERSION)
34+
endif
35+
2636
VERSION_PACKAGE = github.com/mongodb/mongodb-atlas-kubernetes/v2/internal/version
2737

2838
# LD_FLAGS
@@ -252,11 +262,11 @@ envtest-assets:
252262
mkdir -p $(ENVTEST_ASSETS_DIR)
253263

254264
.PHONY: e2e
255-
e2e: bundle manifests run-kind $(BUILD_DEPENDENCY) ## Run e2e test. Command `make e2e label=cluster-ns` run cluster-ns test
265+
e2e: bundle manifests run-kind install-crds $(BUILD_DEPENDENCY) ## Run e2e test. Command `make e2e label=cluster-ns` run cluster-ns test
256266
AKO_E2E_TEST=1 $(GINKGO) $(shell pwd)/test/$@
257267

258268
.PHONY: e2e2
259-
e2e2: run-kind manager install-credentials install-crds set-namespace ## Run e2e2 tests. Command `make e2e2 label=integrations-ctlr` run integrations-ctlr e2e2 test
269+
e2e2: bundle run-kind manager install-credentials install-crds set-namespace ## Run e2e2 tests. Command `make e2e2 label=integrations-ctlr` run integrations-ctlr e2e2 test
260270
NO_GORUN=1 \
261271
AKO_E2E2_TEST=1 \
262272
OPERATOR_NAMESPACE=$(OPERATOR_NAMESPACE) \
@@ -491,12 +501,17 @@ all-platforms:
491501

492502
.PHONY: all-platforms-docker
493503
all-platforms-docker: all-platforms
494-
docker build --build-arg BINARY_PATH=bin/linux/amd64 -f fast.Dockerfile -t manager-amd64 .
495-
docker build --build-arg BINARY_PATH=bin/linux/arm64 -f fast.Dockerfile -t manager-arm64 .
504+
docker build --build-arg TARGETOS=linux --build-arg TARGETARCH=amd64 \
505+
-f fast.Dockerfile -t manager-amd64 .
506+
docker build --build-arg TARGETOS=linux --build-arg TARGETARCH=arm64 \
507+
-f fast.Dockerfile -t manager-arm64 .
496508

509+
# docker-image builds the test image always for linux, even on MacOS.
510+
# This is because the Kubernetes cluster is always run within a Linux VM
497511
.PHONY: docker-image
498-
docker-image:
499-
docker build --build-arg BINARY_PATH=bin/$(TARGET_OS)/$(TARGET_ARCH) -f fast.Dockerfile -t $(DEFAULT_IMAGE_URL) .
512+
docker-image: all-platforms
513+
docker build --build-arg TARGETOS=linux --build-arg TARGETARCH=$(TARGET_ARCH) \
514+
-f fast.Dockerfile -t $(DEFAULT_IMAGE_URL) .
500515

501516
.PHONY: test-docker-image
502517
test-docker-image: docker-image run-kind

0 commit comments

Comments
 (0)