Skip to content

Commit 8d2bcab

Browse files
authored
fix: use published image matching git tag in Helm chart installation (#1413)
1 parent d1ce8c1 commit 8d2bcab

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/helm-tests.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,26 +104,38 @@ jobs:
104104
- name: Install Mondoo Operator Helm chart
105105
env:
106106
BUILD_OPERATOR: ${{ inputs.build-operator }}
107+
GIT_REF_NAME: ${{ github.ref_name }}
107108
run: |
108109
HELM_ARGS="--set operator.createConfig=false"
109110
if [ "$BUILD_OPERATOR" = "true" ]; then
110111
HELM_ARGS="$HELM_ARGS --set controllerManager.manager.image.tag=$(make print-version) --set controllerManager.manager.imagePullPolicy=Never"
112+
else
113+
# Use the published image matching the git tag instead of the chart default
114+
if [ -z "$GIT_REF_NAME" ]; then
115+
echo "::error::GIT_REF_NAME is empty; cannot determine which published image to use"
116+
exit 1
117+
fi
118+
HELM_ARGS="$HELM_ARGS --set controllerManager.manager.image.tag=${GIT_REF_NAME}"
111119
fi
112120
helm install mondoo-operator charts/mondoo-operator -n mondoo-operator --create-namespace --wait $HELM_ARGS
113121
114122
- name: Run integration tests
115123
env:
116124
MONDOO_API_TOKEN: ${{ secrets.MONDOO_TEST_ORG_TOKEN }}
117-
BUILD_OPERATOR: ${{ inputs.build-operator }}
118125
GIT_REF_NAME: ${{ github.ref_name }}
126+
BUILD_OPERATOR: ${{ inputs.build-operator }}
119127
run: |
120128
# When using a pre-built image (build-operator=false), skip the minikube image
121129
# load step (K8S_DISTRO=gke) and pass the git tag as VERSION so the version
122130
# check matches the published operator binary.
123131
if [ "$BUILD_OPERATOR" = "true" ]; then
124132
EXTERNAL_INSTALLATION=1 make test/integration/ci
125133
else
126-
EXTERNAL_INSTALLATION=1 K8S_DISTRO=gke VERSION="$GIT_REF_NAME" make test/integration/ci
134+
if [ -z "$GIT_REF_NAME" ]; then
135+
echo "::error::GIT_REF_NAME is empty; cannot determine published operator version"
136+
exit 1
137+
fi
138+
EXTERNAL_INSTALLATION=1 K8S_DISTRO=gke VERSION="${GIT_REF_NAME}" make test/integration/ci
127139
fi
128140
129141
- run: mv integration-tests.xml integration-tests-helm-${{ matrix.k8s-version }}.xml

0 commit comments

Comments
 (0)