Skip to content

Commit 7149c7b

Browse files
authored
fix: Set correct operator image in init containers (#1530)
* fix: Set correct operator image in init containers - Add missing IMG build-arg to Docker builds in publish workflow - Add OPERATOR_IMAGE env var to Helm deployment template - Fix GHCR build to use correct registry URL instead of Quay.io - Ensures init-config containers use proper versioned images instead of :latest Resolves issue where init-config containers defaulted to :latest tag when GenerateConfigInInitContainer feature gate was enabled. Signed-off-by: yangw <[email protected]> * adjust image Signed-off-by: yangw <[email protected]> --------- Signed-off-by: yangw <[email protected]>
1 parent 7e6fca0 commit 7149c7b

File tree

3 files changed

+8
-33
lines changed

3 files changed

+8
-33
lines changed

.github/workflows/publish-image.yaml

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,13 @@ jobs:
3939
with:
4040
context: .
4141
file: Dockerfile
42+
platforms: linux/amd64,linux/arm64
4243
push: true
44+
build-args: |
45+
IMG=${{ env.REGISTRY }}/${{ env.REPOSITORY }}/redis-operator:${{ env.TAG }}
4346
tags: |
4447
${{ env.REGISTRY }}/${{ env.REPOSITORY }}/redis-operator:${{ env.TAG }}
4548
${{ env.REGISTRY }}/${{ env.REPOSITORY }}/redis-operator:latest
46-
platforms: linux/amd64,linux/arm64
4749
4850
release-quay-image:
4951
runs-on: ubuntu-latest
@@ -76,36 +78,8 @@ jobs:
7678
file: Dockerfile
7779
platforms: linux/amd64,linux/arm64
7880
push: true
81+
build-args: |
82+
IMG=${{ env.QuayImageName }}:${{ env.TAG }}
7983
tags: |
8084
${{ env.QuayImageName }}:${{ env.TAG }}
81-
${{ env.QuayImageName }}:latest
82-
83-
# trivy_scan:
84-
# needs: [release_image]
85-
# runs-on: ubuntu-latest
86-
# steps:
87-
# - name: Checkout
88-
# uses: actions/checkout@v2
89-
# - name: Run Trivy vulnerability scanner for arm64 image
90-
# uses: aquasecurity/trivy-action@master
91-
92-
# - name: Run Trivy vulnerability scanner for multi-arch image
93-
# uses: aquasecurity/trivy-action@master
94-
# with:
95-
# image-ref: ${{ env.QuayImageName }}:${{ env.APP_VERSION }}
96-
# format: 'template'
97-
# template: '@/contrib/sarif.tpl'
98-
# output: 'trivy-results-latest.sarif'
99-
# exit-code: '1'
100-
# ignore-unfixed: true
101-
# severity: 'CRITICAL,HIGH'
102-
# - name: Run Trivy vulnerability scanner for latest image
103-
# uses: aquasecurity/trivy-action@master
104-
# with:
105-
# image-ref: ${{ env.QuayImageName }}:latest
106-
# format: 'template'
107-
# template: '@/contrib/sarif.tpl'
108-
# output: 'trivy-results-latest.sarif'
109-
# exit-code: '1'
110-
# ignore-unfixed: true
111-
# severity: 'CRITICAL,HIGH'
85+
${{ env.QuayImageName }}:latest

charts/redis-operator/Chart.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ description: Provides easy redis setup definitions for Kubernetes services, and
66
engine: gotpl
77
maintainers:
88
- name: iamabhishek-dubey
9-
109
- name: sandy724
1110
- name: shubham-cmyk
1211
name: redis-operator

charts/redis-operator/templates/operator-deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ spec:
8686
readOnly: true
8787
{{- end }}
8888
env:
89+
- name: OPERATOR_IMAGE
90+
value: {{ .Values.redisOperator.imageName }}:{{ .Values.redisOperator.imageTag | default (printf "v%s" .Chart.AppVersion) }}
8991
- name: ENABLE_WEBHOOKS
9092
value: {{ .Values.redisOperator.webhook | quote }}
9193
{{- if .Values.redisOperator.watchNamespace }}

0 commit comments

Comments
 (0)