-
Notifications
You must be signed in to change notification settings - Fork 776
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
Helm template with custom podLabels failes #3145
Comments
I am affected by this as well. This patch fixes the bug: diff --git a/templates/gatekeeper-audit-deployment.yaml b/templates/gatekeeper-audit-deployment.yaml
index 1dc1ebac29..a9e3132848 100644
--- a/templates/gatekeeper-audit-deployment.yaml
+++ b/templates/gatekeeper-audit-deployment.yaml
@@ -33,7 +33,7 @@ spec:
{{- toYaml .Values.auditPodAnnotations | trim | nindent 8 }}
{{- end }}
labels:
-{{- include "gatekeeper.podLabels" . }}
+ {{- include "gatekeeper.podLabels" . | nindent 8 }}
app: '{{ template "gatekeeper.name" . }}'
chart: '{{ template "gatekeeper.name" . }}'
control-plane: audit-controller
diff --git a/templates/gatekeeper-controller-manager-deployment.yaml b/templates/gatekeeper-controller-manager-deployment.yaml
index 70c7571c2c..3d2c32a7b7 100644
--- a/templates/gatekeeper-controller-manager-deployment.yaml
+++ b/templates/gatekeeper-controller-manager-deployment.yaml
@@ -32,7 +32,7 @@ spec:
{{- toYaml .Values.podAnnotations | trim | nindent 8 }}
{{- end }}
labels:
-{{- include "gatekeeper.podLabels" . }}
+ {{- include "gatekeeper.podLabels" . | nindent 8 }}
app: '{{ template "gatekeeper.name" . }}'
chart: '{{ template "gatekeeper.name" . }}'
control-plane: controller-manager However, there is some weird machinery going on for somehow autogenerating the Helm chart that I do not understand. Can someone that does please apply the above patch? I don't think this patch is significant enough to warrant copyright, but if it is, I'm putting it in the public domain or, in legal domains where public domain does not exist, hereby publishing it under CC0 license. |
This reverts commit 56d46ce. Upgrade is broken because of open-policy-agent/gatekeeper#3145
This should fix the issue #3153 |
What steps did you take and what happened:
Running helm template with custom .values.podLabels will result in an error:
Error: YAML parse error on gatekeeper/charts/gatekeeper/templates/gatekeeper-audit-deployment.yaml: error converting YAML to JSON: yaml: line 30: mapping values are not allowed in this context
What did you expect to happen:
Helm template will work just fine.
Anything else you would like to add:
I guess it is due to the change in the _helper.tpl
which removed the
nindent 8
and cause now the error within the deployments using{{- include "gatekeeper.podLabels" . }}
Environment:
The text was updated successfully, but these errors were encountered: