Skip to content

Commit

Permalink
chore: Changed the process to expand yaml so that maxUnavailable, etc…
Browse files Browse the repository at this point in the history
…. can be used.

Signed-off-by: kahirokunn <[email protected]>
  • Loading branch information
kahirokunn committed Sep 9, 2024
1 parent 7c6107d commit d79a20b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/build/helmify/kustomize-for-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ metadata:
name: gatekeeper-controller-manager
namespace: gatekeeper-system
spec:
minAvailable: HELMSUBST_PDB_CONTROLLER_MANAGER_MINAVAILABLE
minAvailable: HELMSUBST_PDB_CONTROLLER_MANAGER
selector:
matchLabels:
control-plane: controller-manager
Expand Down
12 changes: 11 additions & 1 deletion cmd/build/helmify/replacements.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,17 @@ var replacements = map[string]string{

"HELMSUBST_MUTATING_WEBHOOK_MATCH_CONDITIONS": `{{ toYaml .Values.mutatingWebhookMatchConditions | nindent 4 }}`,

"HELMSUBST_PDB_CONTROLLER_MANAGER_MINAVAILABLE": `{{ .Values.pdb.controllerManager.minAvailable }}`,
"HELMSUBST_PDB_CONTROLLER_MANAGER": `{{- if and .Values.maxAvailable .Values.maxUnavailable }}
{{ fail "Only one of 'maxAvailable' or 'maxUnavailable' can be set, but not both" }}
{{- else if not (or .Values.maxAvailable .Values.maxUnavailable) }}
{{ fail "One of 'maxAvailable' or 'maxUnavailable' must be set" }}
{{- else }}
{{ if .Values.maxAvailable }}
maxAvailable: {{ .Values.maxAvailable }}
{{ else if .Values.maxUnavailable }}
maxUnavailable: {{ .Values.maxUnavailable }}
{{ end }}
{{- end }}`,

`HELMSUBST_AUDIT_CONTROLLER_MANAGER_DEPLOYMENT_IMAGE_RELEASE: ""`: `{{- if .Values.image.release }}
image: {{ .Values.image.repository }}:{{ .Values.image.release }}
Expand Down

0 comments on commit d79a20b

Please sign in to comment.