Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Changed the process to expand yaml so that maxUnavailable, etc. can be used. #3199

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -316,7 +316,7 @@ metadata:
name: gatekeeper-controller-manager
namespace: gatekeeper-system
spec:
minAvailable: HELMSUBST_PDB_CONTROLLER_MANAGER_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 @@ -268,7 +268,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
1 change: 0 additions & 1 deletion config/pdb/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ kind: PodDisruptionBudget
metadata:
name: controller-manager
spec:
minAvailable: 1
selector:
matchLabels:
control-plane: controller-manager
Expand Down
1 change: 0 additions & 1 deletion deploy/gatekeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5141,7 +5141,6 @@ metadata:
name: gatekeeper-controller-manager
namespace: gatekeeper-system
spec:
minAvailable: 1
selector:
matchLabels:
control-plane: controller-manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,17 @@ metadata:
name: gatekeeper-controller-manager
namespace: '{{ .Release.Namespace }}'
spec:
minAvailable: {{ .Values.pdb.controllerManager.minAvailable }}
{{- 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 }}: ""
selector:
matchLabels:
app: '{{ template "gatekeeper.name" . }}'
Expand Down
1 change: 0 additions & 1 deletion manifest_staging/deploy/gatekeeper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5288,7 +5288,6 @@ metadata:
name: gatekeeper-controller-manager
namespace: gatekeeper-system
spec:
minAvailable: 1
selector:
matchLabels:
control-plane: controller-manager
Expand Down