Skip to content

Commit

Permalink
fix bats
Browse files Browse the repository at this point in the history
  • Loading branch information
kschoche committed Jan 27, 2022
1 parent 16e29e3 commit 5717075
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions charts/consul/test/unit/controller-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -92,20 +92,12 @@ load _helpers
--set 'global.tls.enabled=true' \
--set 'global.acls.manageSystemACLs=true' \
. | tee /dev/stderr |
yq '.spec.template.spec.initContainers[0]' | tee /dev/stderr)

local actual=$(echo $object |
yq -r '.name' | tee /dev/stderr)
[ "${actual}" = "controller-acl-init" ]
yq '.spec.template.spec.initContainers[] | select(.name == "controller-acl-init")' | tee /dev/stderr)

local actual=$(echo $object |
yq -r '.command | any(contains("consul-k8s-control-plane acl-init"))' | tee /dev/stderr)
[ "${actual}" = "true" ]

local actual=$(echo $object |
yq -r '.command | any(contains("mkdir -p /consul/connect-inject"))' | tee /dev/stderr)
[ "${actual}" = "true" ]

local actual=$(echo $object |
yq '[.env[1].name] | any(contains("CONSUL_CACERT"))' | tee /dev/stderr)
[ "${actual}" = "true" ]
Expand Down Expand Up @@ -133,20 +125,12 @@ load _helpers
--set 'global.tls.enableAutoEncrypt=true' \
--set 'global.acls.manageSystemACLs=true' \
. | tee /dev/stderr |
yq '.spec.template.spec.initContainers[0]' | tee /dev/stderr)

local actual=$(echo $object |
yq -r '.name' | tee /dev/stderr)
[ "${actual}" = "controller-acl-init" ]
yq '.spec.template.spec.initContainers[] | select(.name == "controller-acl-init")' | tee /dev/stderr)

local actual=$(echo $object |
yq -r '.command | any(contains("consul-k8s-control-plane acl-init"))' | tee /dev/stderr)
[ "${actual}" = "true" ]

local actual=$(echo $object |
yq -r '.command | any(contains("mkdir -p /consul/connect-inject"))' | tee /dev/stderr)
[ "${actual}" = "true" ]

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

0 comments on commit 5717075

Please sign in to comment.