Skip to content

Commit

Permalink
charts/consul: update tests and changelog for #938 by @Lord-Y
Browse files Browse the repository at this point in the history
  • Loading branch information
ndhanushkodi committed Jan 4, 2022
1 parent 190e87c commit c7a2178
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
## UNRELEASED
IMPROVEMENTS:
* Helm
* Allow customization of `terminationGracePeriodSeconds` on the ingress gateways. [[GH-947](https://github.com/hashicorp/consul-k8s/pull/947)]

## 0.39.0 (December 15, 2021)

Expand Down
19 changes: 15 additions & 4 deletions charts/consul/test/unit/ingress-gateways-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -1614,7 +1614,7 @@ EOF
#--------------------------------------------------------------------
# terminationGracePeriodSeconds

@test "ingressGateways/Deployment: can set terminationGracePeriodSeconds through defaults" {
@test "ingressGateways/Deployment: terminationGracePeriodSeconds defaults to 10" {
cd `chart_dir`
local actual=$(helm template \
-s templates/ingress-gateways-deployment.yaml \
Expand All @@ -1625,16 +1625,27 @@ EOF
[ "${actual}" = "10" ]
}

@test "ingressGateways/Deployment: terminationGracePeriodSeconds can be set through defaults" {
cd `chart_dir`
local actual=$(helm template \
-s templates/ingress-gateways-deployment.yaml \
--set 'ingressGateways.enabled=true' \
--set 'connectInject.enabled=true' \
--set 'ingressGateways.defaults.terminationGracePeriodSeconds=5' \
. | tee /dev/stderr |
yq -s -r '.[0].spec.template.spec.terminationGracePeriodSeconds' | tee /dev/stderr)
[ "${actual}" = "5" ]
}

@test "ingressGateways/Deployment: can set terminationGracePeriodSeconds through specific gateway overriding defaults" {
cd `chart_dir`
local actual=$(helm template \
-s templates/ingress-gateways-deployment.yaml \
--set 'ingressGateways.enabled=true' \
--set 'connectInject.enabled=true' \
--set 'ingressGateways.defaults.replicas=3' \
--set 'ingressGateways.defaults.terminationGracePeriodSeconds=5' \
--set 'ingressGateways.gateways[0].name=gateway1' \
--set 'ingressGateways.gateways[0].replicas=12' \
--set 'ingressGateways.defaults.terminationGracePeriodSeconds=30' \
--set 'ingressGateways.gateways[0].terminationGracePeriodSeconds=30' \
. | tee /dev/stderr |
yq -s -r '.[0].spec.template.spec.terminationGracePeriodSeconds' | tee /dev/stderr)
[ "${actual}" = "30" ]
Expand Down

0 comments on commit c7a2178

Please sign in to comment.