diff --git a/deploy/charts/trust-manager/templates/_helpers.tpl b/deploy/charts/trust-manager/templates/_helpers.tpl index dbb75906..7407c446 100644 --- a/deploy/charts/trust-manager/templates/_helpers.tpl +++ b/deploy/charts/trust-manager/templates/_helpers.tpl @@ -13,6 +13,13 @@ Create chart name and version as used by the chart label. {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{/* +Get Values.app.trust.namespace as a templated value +*/}} +{{- define "trust-manager.trust.namespace" -}} +{{- tpl .Values.app.trust.namespace . -}} +{{- end -}} + {{/* Common labels */}} diff --git a/deploy/charts/trust-manager/templates/certificate.yaml b/deploy/charts/trust-manager/templates/certificate.yaml index d038934a..69a18e75 100644 --- a/deploy/charts/trust-manager/templates/certificate.yaml +++ b/deploy/charts/trust-manager/templates/certificate.yaml @@ -87,7 +87,7 @@ roleRef: subjects: - kind: ServiceAccount name: {{ .Values.app.webhook.tls.approverPolicy.certManagerServiceAccount }} - namespace: {{ .Values.app.webhook.tls.approverPolicy.certManagerNamespace }} + namespace: {{ tpl .Values.app.webhook.tls.approverPolicy.certManagerNamespace . }} {{ end }} diff --git a/deploy/charts/trust-manager/templates/deployment.yaml b/deploy/charts/trust-manager/templates/deployment.yaml index 27e742b1..8227a4a2 100644 --- a/deploy/charts/trust-manager/templates/deployment.yaml +++ b/deploy/charts/trust-manager/templates/deployment.yaml @@ -83,7 +83,7 @@ spec: - "--leader-election-lease-duration={{.Values.app.leaderElection.leaseDuration}}" - "--leader-election-renew-deadline={{.Values.app.leaderElection.renewDeadline}}" # trust - - "--trust-namespace={{.Values.app.trust.namespace}}" + - {{ printf "--trust-namespace=%s" (include "trust-manager.trust.namespace" .) | quote }} # webhook - "--webhook-host={{.Values.app.webhook.host}}" - "--webhook-port={{.Values.app.webhook.port}}" diff --git a/deploy/charts/trust-manager/templates/role.yaml b/deploy/charts/trust-manager/templates/role.yaml index 2ba9eb6b..e38cc05c 100644 --- a/deploy/charts/trust-manager/templates/role.yaml +++ b/deploy/charts/trust-manager/templates/role.yaml @@ -2,7 +2,7 @@ kind: Role apiVersion: rbac.authorization.k8s.io/v1 metadata: name: {{ include "trust-manager.name" . }} - namespace: {{ .Values.app.trust.namespace }} + namespace: {{ include "trust-manager.trust.namespace" . }} labels: {{- include "trust-manager.labels" . | nindent 4 }} rules: diff --git a/deploy/charts/trust-manager/templates/rolebinding.yaml b/deploy/charts/trust-manager/templates/rolebinding.yaml index 7425ed08..34a8f3fc 100644 --- a/deploy/charts/trust-manager/templates/rolebinding.yaml +++ b/deploy/charts/trust-manager/templates/rolebinding.yaml @@ -2,7 +2,7 @@ kind: RoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: {{ include "trust-manager.name" . }} - namespace: {{ .Values.app.trust.namespace }} + namespace: {{ include "trust-manager.trust.namespace" . }} labels: {{- include "trust-manager.labels" . | nindent 4 }} roleRef: