Skip to content

Commit

Permalink
Use versioned logger image in the testing instead of :latest
Browse files Browse the repository at this point in the history
Add missing shell directive

Fix checkout-strategy for the docker build job
  • Loading branch information
burmanm committed Jul 18, 2023
1 parent ea7386e commit 28b4273
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
10 changes: 9 additions & 1 deletion .github/actions/run-integ-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,20 @@ runs:
run: |
docker load --input /tmp/k8ssandra-cass-operator.tar
docker load --input /tmp/k8ssandra-system-logger.tar
- name: Set version value
id: vars
shell: bash
run: |
echo "version=$(make version)" >> $GITHUB_OUTPUT
- name: Load image on the nodes of the cluster
shell: bash
run: |
kind load docker-image --name=kind k8ssandra/cass-operator:latest
kind load docker-image --name=kind k8ssandra/system-logger:latest
kind load docker-image --name=kind k8ssandra/cass-operator:v${{ steps.vars.outputs.version }}
kind load docker-image --name=kind k8ssandra/system-logger:v${{ steps.vars.outputs.version }}
- name: Run integration test ( ${{ inputs.integration_test }} )
shell: bash
run: |
IMG=k8ssandra/cass-operator:latest make integ-test
IMG=k8ssandra/cass-operator:v${{ steps.vars.outputs.version }} LOG_IMG=k8ssandra/system-logger:v${{ steps.vars.outputs.version }} make integ-test
10 changes: 8 additions & 2 deletions .github/workflows/kindIntegTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ jobs:
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Set version value
id: vars
run: |
echo "version=$(make version)" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and push
Expand All @@ -22,7 +28,7 @@ jobs:
file: Dockerfile
context: .
push: false
tags: k8ssandra/cass-operator:latest
tags: k8ssandra/cass-operator:latest, k8ssandra/cass-operator:v${{ steps.vars.outputs.version }}
platforms: linux/amd64
outputs: type=docker,dest=/tmp/k8ssandra-cass-operator.tar
cache-from: type=local,src=/tmp/.buildx-cache
Expand All @@ -32,7 +38,7 @@ jobs:
with:
file: logger.Dockerfile
push: false
tags: k8ssandra/system-logger:latest
tags: k8ssandra/system-logger:latest, k8ssandra/system-logger:v${{ steps.vars.outputs.version }}
outputs: type=docker,dest=/tmp/k8ssandra-system-logger.tar
platforms: linux/amd64
cache-from: type=local,src=/tmp/.buildx-cache
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/operatorBuildAndDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
file: Dockerfile
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: k8ssandra/cass-operator:${{ steps.vars.outputs.sha_short }}, k8ssandra/cass-operator:latest, k8ssandra/cass-operator:${{ steps.vars.outputs.version }}
tags: k8ssandra/cass-operator:${{ steps.vars.outputs.sha_short }}, k8ssandra/cass-operator:latest, k8ssandra/cass-operator:v${{ steps.vars.outputs.version }}
platforms: linux/amd64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
Expand All @@ -87,7 +87,7 @@ jobs:
with:
file: logger.Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: k8ssandra/system-logger:${{ steps.vars.outputs.sha_short }}, k8ssandra/system-logger:latest
tags: k8ssandra/system-logger:${{ steps.vars.outputs.sha_short }}, k8ssandra/system-logger:latest, k8ssandra/system-logger:v${{ steps.vars.outputs.version }}
platforms: linux/amd64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ uninstall: manifests ## Uninstall CRDs from the K8s cluster specified in ~/.kube
.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
LOG_IMG=${LOG_IMG} yq eval -i '.images.system-logger = env(LOG_IMG)' config/manager/image_config.yaml
kubectl apply --force-conflicts --server-side -k config/deployments/default

.PHONY: undeploy
Expand All @@ -216,6 +217,7 @@ ifneq ($(strip $(NAMESPACE)),)
cd tests/kustomize && $(KUSTOMIZE) edit set namespace $(NAMESPACE)
endif
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
LOG_IMG=${LOG_IMG} yq eval -i '.images.system-logger = env(LOG_IMG)' config/manager/image_config.yaml
kubectl apply --force-conflicts --server-side -k tests/$(TEST_DIR)

.PHONY: undeploy-test
Expand All @@ -242,7 +244,7 @@ HELM ?= $(LOCALBIN)/helm
OPM ?= $(LOCALBIN)/opm

## Tool Versions
CERT_MANAGER_VERSION ?= v1.11.3
CERT_MANAGER_VERSION ?= v1.12.2
KUSTOMIZE_VERSION ?= v5.0.3
CONTROLLER_TOOLS_VERSION ?= v0.12.0
OPERATOR_SDK_VERSION ?= 1.29.0
Expand Down

0 comments on commit 28b4273

Please sign in to comment.