Skip to content

Commit

Permalink
fix accpetance test
Browse files Browse the repository at this point in the history
  • Loading branch information
absolutelightning committed Sep 11, 2023
1 parent fcb1b3e commit b0425d6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 0 additions & 1 deletion acceptance/tests/vault/vault_namespaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ func TestVault_VaultNamespace(t *testing.T) {
"global.secretsBackend.vault.connectCA.rootPKIPath": connectCARootPath,
"global.secretsBackend.vault.connectCA.intermediatePKIPath": connectCAIntermediatePath,
"global.secretsBackend.vault.vaultNamespace": vaultNamespacePath,
"global.secretsBackend.vault.agentAnnotations": fmt.Sprintf("\"vault.hashicorp.com/namespace\": \"%s\"", vaultNamespacePath),
"global.acls.manageSystemACLs": "true",
"global.acls.bootstrapToken.secretName": bootstrapTokenSecret.Path,
"global.acls.bootstrapToken.secretKey": bootstrapTokenSecret.Key,
Expand Down
3 changes: 3 additions & 0 deletions charts/consul/templates/ingress-gateways-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ spec:
{{- if $root.Values.global.secretsBackend.vault.agentAnnotations }}
{{ tpl $root.Values.global.secretsBackend.vault.agentAnnotations $root | nindent 8 | trim }}
{{- end }}
{{- if (and ($root.Values.global.secretsBackend.vault.vaultNamespace) (not (hasKey (default "" $root.Values.global.secretsBackend.vault.agentAnnotations | fromYaml) "vault.hashicorp.com/namespace")))}}
"vault.hashicorp.com/namespace": "{{ $root.Values.global.secretsBackend.vault.vaultNamespace }}"
{{- end }}
{{- end }}
{{- if (and $root.Values.global.metrics.enabled $root.Values.global.metrics.enableGatewayMetrics) }}
"prometheus.io/scrape": "true"
Expand Down
7 changes: 5 additions & 2 deletions charts/consul/templates/server-acl-init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,12 @@ spec:
fieldPath: metadata.name
# Extract the Vault namespace from the Vault agent annotations.
{{- if .Values.global.secretsBackend.vault.enabled }}
{{- if .Values.global.secretsBackend.vault.agentAnnotations }}
{{- if and (.Values.global.secretsBackend.vault.agentAnnotations) (hasKey default "" .Values.global.secretsBackend.vault.agentAnnotations | fromYaml "vault.hashicorp.com/namespace") }}
- name: VAULT_NAMESPACE
value: {{ get (tpl .Values.global.secretsBackend.vault.agentAnnotations | fromYaml) "vault.hashicorp.com/namespace" }}
{{- else if .Values.global.secretsBackend.vault.vaultNamespace }}
- name: VAULT_NAMESPACE
value: {{ get (tpl .Values.global.secretsBackend.vault.agentAnnotations . | fromYaml) "vault.hashicorp.com/namespace" }}
value: {{ .Values.global.secretsBackend.vault.vaultNamespace }}
{{- end }}
{{- end }}
{{- include "consul.consulK8sConsulServerEnvVars" . | nindent 8 }}
Expand Down
3 changes: 3 additions & 0 deletions charts/consul/templates/terminating-gateways-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ spec:
{{- if $root.Values.global.secretsBackend.vault.agentAnnotations }}
{{ tpl $root.Values.global.secretsBackend.vault.agentAnnotations $root | nindent 8 | trim }}
{{- end }}
{{- if (and ($root.Values.global.secretsBackend.vault.vaultNamespace) (not (hasKey (default "" $root.Values.global.secretsBackend.vault.agentAnnotations | fromYaml) "vault.hashicorp.com/namespace")))}}
"vault.hashicorp.com/namespace": "{{ $root.Values.global.secretsBackend.vault.vaultNamespace }}"
{{- end }}
{{- end }}
{{- if (and $root.Values.global.metrics.enabled $root.Values.global.metrics.enableGatewayMetrics) }}
"prometheus.io/scrape": "true"
Expand Down

0 comments on commit b0425d6

Please sign in to comment.