Skip to content

Commit

Permalink
Merge branch 'main' into add-recreate-type
Browse files Browse the repository at this point in the history
  • Loading branch information
ericgraf authored Feb 6, 2024
2 parents 0b406e6 + 5c72473 commit d7bb275
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 7 deletions.
13 changes: 7 additions & 6 deletions charts/zot/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ spec:
{{- include "zot.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- if or .Values.forceRoll .Values.podAnnotations}}
annotations:
{{- end }}
{{- with .Values.podAnnotations }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.forceRoll }}
{{- end }}
{{- if and .Values.mountConfig .Values.configFiles }}
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- end }}
{{- if .Values.forceRoll }}
rollme: {{ randAlphaNum 5 | quote }}
{{- end }}
{{- end }}
labels:
{{- include "zot.selectorLabels" . | nindent 8 }}
spec:
Expand Down
23 changes: 23 additions & 0 deletions charts/zot/unittests/configmap_checksum_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
suite: configmap checksum in deployment
# Can't use global templates in this test suite as it will break the checksum calculation
# causing false negative test outcome.
# templates:
# - deployment.yaml
tests:
- it: has no checksum/config if no config
template: deployment.yaml
asserts:
- isNull:
path: spec.template.metadata.annotations.checksum/config
- it: generate checksum/config if config is present
template: deployment.yaml
set:
mountConfig: true
configFiles:
config.json: "{}"
asserts:
- isNotNull:
path: spec.template.metadata.annotations.checksum/config
- matchRegex:
path: spec.template.metadata.annotations.checksum/config
pattern: "^[a-f0-9]{64}$" # SHA256 hex output
5 changes: 4 additions & 1 deletion charts/zot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ image:
repository: ghcr.io/project-zot/zot-linux-amd64
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "v2.0.1"
tag: "v2.0.2-rc1"
serviceAccount:
# Specifies whether a service account should be created
create: true
Expand Down Expand Up @@ -177,3 +177,6 @@ strategy:
type: RollingUpdate
# rollingUpdate:
# maxUnavailable: 25%

podAnnotations: {}

Check failure on line 182 in charts/zot/values.yaml

View workflow job for this annotation

GitHub Actions / helm-chart-release

182:1 [empty-lines] too many blank lines (1 > 0)

0 comments on commit d7bb275

Please sign in to comment.