Skip to content

Commit

Permalink
Support image digest (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
baksetercx authored Jan 21, 2025
1 parent 7b7c84c commit 79f1918
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CI/demo-api-values-progressive.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ strategy:

image:
repository: containerregistryelvia.azurecr.io/core-demo-api
tag: "latest-cache"
digest: sha256:7a01e22d7695c70d87de15be46001c20e3aefcd32284ecebbffb5d28aa4d6ed9

#expect configMap for each to exist for common configmap
envFrom:
Expand Down
8 changes: 4 additions & 4 deletions elvia-deployment/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ Define the image, using containerregistryelvia.azurecr.io as default container r
*/}}
{{- define "image" -}}
{{- if .Values.image.repository }}
{{- .Values.image.repository }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}
{{- else }}
{{- printf "containerregistryelvia.azurecr.io/%s-%s" .Values.namespace .Values.name }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}
{{- .Values.image.repository }}{{- if .Values.image.digest }}@{{ .Values.image.digest }}{{- else }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}{{- end }}
{{- else }}
{{- printf "containerregistryelvia.azurecr.io/%s-%s" .Values.namespace .Values.name }}{{- if .Values.image.digest }}@{{ .Values.image.digest }}{{- else }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}{{- end }}
{{- end }}
{{- end }}

Expand All @@ -82,7 +82,7 @@ Define the sidecar.image, using containerregistryelvia.azurecr.io as default con
{{- end}}
{{- if .sidecar.image.repository }}
{{- .sidecar.image.repository }}:{{ required "Missing $imagetag" $imagetag }}
{{- else }}
{{- else }}
{{- printf "containerregistryelvia.azurecr.io/%s-%s" .namespace .sidecar.name }}:{{ required "Missing $imagetag" $imagetag }}
{{- end }}
{{- end }}
Expand Down
3 changes: 2 additions & 1 deletion elvia-deployment/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
"replicaCount": 2,
"image": {
"repository": "containerregistryelvia.azurecr.io/github-repository-team-adder",
"tag": "20200921.2"
"tag": "20200921.2",
"digest": "sha256:a8ed8ccd193c1cd070fdeff3a7a4ad133424b8cc5f9d02caf3dd0ce75d63d5d5"
},
"imagePullSecret": "containerregistryelvia",
"env": [
Expand Down
3 changes: 2 additions & 1 deletion elvia-deployment/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@

# image:
# repository: containerregistryelvia.azurecr.io/bad-realtimeunits-api # defaults to containerregistryelvia.azurecr.io/$namespace-$name
# tag: "ToBeReplaced"
# tag: ToBeReplaced
# digest: ToBeReplaced

# imagePullSecret: containerregistryelvia

Expand Down
6 changes: 3 additions & 3 deletions elvia-statefulset/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ Define the image, using containerregistryelvia.azurecr.io as default container r
*/}}
{{- define "image" -}}
{{- if .Values.image.repository }}
{{- .Values.image.repository }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}
{{- else }}
{{- printf "containerregistryelvia.azurecr.io/%s-%s" .Values.namespace .Values.name }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}
{{- .Values.image.repository }}{{- if .Values.image.digest }}@{{ .Values.image.digest }}{{- else }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}{{- end }}
{{- else }}
{{- printf "containerregistryelvia.azurecr.io/%s-%s" .Values.namespace .Values.name }}{{- if .Values.image.digest }}@{{ .Values.image.digest }}{{- else }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}{{- end }}
{{- end }}
{{- end }}

Expand Down
3 changes: 2 additions & 1 deletion elvia-statefulset/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"replicaCount": 2,
"image": {
"repository": "containerregistryelvia.azurecr.io/github-repository-team-adder",
"tag": "20200921.2"
"tag": "20200921.2",
"digest": "sha256:a8ed8ccd193c1cd070fdeff3a7a4ad133424b8cc5f9d02caf3dd0ce75d63d5d5"
},
"imagePullSecret": "containerregistryelvia",
"env": [
Expand Down
3 changes: 2 additions & 1 deletion elvia-statefulset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@

# image:
# repository: containerregistryelvia.azurecr.io/bad-realtimeunits-api # defaults to containerregistryelvia.azurecr.io/$namespace-$name
# tag: "ToBeReplaced"
# tag: ToBeReplaced
# digest: ToBeReplaced

# imagePullSecret: containerregistryelvia

Expand Down
2 changes: 1 addition & 1 deletion iss-deployment/examples/demo-api/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: demo-api
namespace: adms-extensions
microserviceType: webapi

replicaCount:
replicaCount:
dev: 1
test: 1
prod: 2
Expand Down
12 changes: 6 additions & 6 deletions iss-deployment/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,20 +62,20 @@ Create the name of the service account to use
{{- end }}

{{/*
Define the image value. The image is different in each environment.
Define the image value. The image is different in each environment.
*/}}
{{- define "image" -}}
{{- if .Values.image.repository }}
{{- .Values.image.repository }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}
{{- else }}
{{- .Values.image.repository }}{{- if .Values.image.digest }}@{{ .Values.image.digest }}{{- else }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}{{- end }}
{{- else }}
{{- if eq .Values.environment "dev"}}
{{- printf "gcr.io/iss-dev-88440/%s-%s" .Values.namespace .Values.name }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}
{{- printf "gcr.io/iss-dev-88440/%s-%s" .Values.namespace .Values.name }}{{- if .Values.image.digest }}@{{ .Values.image.digest }}{{- else }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}{{- end }}
{{- end }}
{{- if eq .Values.environment "test"}}
{{- printf "gcr.io/iss-test-79771/%s-%s" .Values.namespace .Values.name }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}
{{- printf "gcr.io/iss-test-79771/%s-%s" .Values.namespace .Values.name }}{{- if .Values.image.digest }}@{{ .Values.image.digest }}{{- else }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}{{- end }}
{{- end }}
{{- if eq .Values.environment "prod"}}
{{- printf "gcr.io/iss-prod-91279/%s-%s" .Values.namespace .Values.name }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}
{{- printf "gcr.io/iss-prod-91279/%s-%s" .Values.namespace .Values.name }}{{- if .Values.image.digest }}@{{ .Values.image.digest }}{{- else }}:{{ required "Missing .Values.image.tag" .Values.image.tag }}{{- end }}
{{- end }}
{{- end }}
{{- end }}
Expand Down
3 changes: 2 additions & 1 deletion iss-deployment/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

# image:
# repository: containerregistryelvia.azurecr.io/bad-realtimeunits-api # defaults to containerregistryelvia.azurecr.io/$namespace-$name
# tag: "ToBeReplaced"
# tag: ToBeReplaced
# digest: ToBeReplaced

# imagePullSecret: containerregistryelvia

Expand Down

0 comments on commit 79f1918

Please sign in to comment.