Skip to content

Commit

Permalink
[Backport v0.29.x-gp] Fix helm template syntax issue (#507)
Browse files Browse the repository at this point in the history
* fix, changelog (#504)

* move changelog
  • Loading branch information
arianaw66 authored Oct 4, 2023
1 parent d9c4edb commit 1597b47
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
changelog:
- type: FIX
issueLink: https://github.com/solo-io/gloo-mesh-enterprise/issues/12164
resolvesIssue: false
description: Prefix some lines declaring new vars with '#' in helm templates to avoid printing variable values in yaml. See issue description for more context.
7 changes: 4 additions & 3 deletions codegen/templates/chart/operator-rbac.yamltmpl
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ We need the following variables:
1. map of namespace -> list of resources
2. list of resources to be namespace restricted
3. list of namespaced resources that the operator supports
Prefixed with '#' to avoid printing variable values in yaml, per https://github.com/solo-io/gloo-mesh-enterprise/issues/12164
*/ -]]
{{- $[[ $operatorVar ]]NsToResources := dict }}
{{- $[[ $operatorVar ]]NamespacedResources := list }}
{{- $[[ $operatorVar ]]SupportedResources := list }}
#{{- $[[ $operatorVar ]]NsToResources := dict }}
#{{- $[[ $operatorVar ]]NamespacedResources := list }}
#{{- $[[ $operatorVar ]]SupportedResources := list }}
[[- range $resource, $_ := $operator.NamespaceRbac ]]
{{- $[[ $operatorVar ]]SupportedResources = append $[[ $operatorVar ]]SupportedResources [[ quote $resource ]] }}
[[- end ]]
Expand Down
6 changes: 3 additions & 3 deletions codegen/test/chart/templates/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ roleRef:
name: painter-{{ .Release.Namespace }}
apiGroup: rbac.authorization.k8s.io

{{- $painterNsToResources := dict }}
{{- $painterNamespacedResources := list }}
{{- $painterSupportedResources := list }}
#{{- $painterNsToResources := dict }}
#{{- $painterNamespacedResources := list }}
#{{- $painterSupportedResources := list }}
{{- $painterSupportedResources = append $painterSupportedResources "secrets" }}

{{- range $entry := $painter.namespacedRbac }}
Expand Down

0 comments on commit 1597b47

Please sign in to comment.