Skip to content

Commit

Permalink
Merge f1c9642 into backport/ashwin/NET-1750-fix-bug-in-login-datacent…
Browse files Browse the repository at this point in the history
…er/early-current-titmouse
  • Loading branch information
hc-github-team-consul-core authored Jul 25, 2023
2 parents b77f798 + f1c9642 commit 90ecce0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .changelog/2652.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
helm: fix CONSUL_LOGIN_DATACENTER for consul client-daemonset.
```
4 changes: 0 additions & 4 deletions charts/consul/templates/client-daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -510,11 +510,7 @@ spec:
value: "component=client,pod=$(NAMESPACE)/$(POD_NAME)"
{{- end }}
- name: CONSUL_LOGIN_DATACENTER
{{- if and .Values.global.federation.enabled .Values.global.federation.primaryDatacenter }}
value: {{ .Values.global.federation.primaryDatacenter }}
{{- else }}
value: {{ .Values.global.datacenter }}
{{- end}}
command:
- "/bin/sh"
- "-ec"
Expand Down
23 changes: 0 additions & 23 deletions charts/consul/test/unit/client-daemonset.bats
Original file line number Diff line number Diff line change
Expand Up @@ -2127,29 +2127,6 @@ rollingUpdate:
[[ "$output" =~ "If global.federation.enabled is true, global.adminPartitions.enabled must be false because they are mutually exclusive" ]]
}

@test "client/DaemonSet: consul login datacenter is set to primary when when federation enabled in non-primary datacenter" {
cd `chart_dir`
local object=$(helm template \
-s templates/client-daemonset.yaml \
--set 'client.enabled=true' \
--set 'meshGateway.enabled=true' \
--set 'global.acls.manageSystemACLs=true' \
--set 'global.datacenter=dc1' \
--set 'global.federation.enabled=true' \
--set 'global.federation.primaryDatacenter=dc2' \
--set 'global.tls.enabled=true' \
. | tee /dev/stderr |
yq '.spec.template.spec.initContainers[] | select(.name == "client-acl-init")' | tee /dev/stderr)

local actual=$(echo $object |
yq '[.env[11].name] | any(contains("CONSUL_LOGIN_DATACENTER"))' | tee /dev/stderr)
[ "${actual}" = "true" ]

local actual=$(echo $object |
yq '[.env[11].value] | any(contains("dc2"))' | tee /dev/stderr)
[ "${actual}" = "true" ]
}

#--------------------------------------------------------------------
# extraContainers

Expand Down

0 comments on commit 90ecce0

Please sign in to comment.