Fix unit tests for change to disable connect inject default
This commit is contained in:
parent
fefc929895
commit
a1528eda46
3 changed files with 12 additions and 6 deletions
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
load _helpers
|
load _helpers
|
||||||
|
|
||||||
@test "connectInject/Deployment: enabled by default" {
|
@test "connectInject/Deployment: disabled by default" {
|
||||||
cd `chart_dir`
|
cd `chart_dir`
|
||||||
local actual=$(helm template \
|
local actual=$(helm template \
|
||||||
-x templates/connect-inject-deployment.yaml \
|
-x templates/connect-inject-deployment.yaml \
|
||||||
. | tee /dev/stderr |
|
. | tee /dev/stderr |
|
||||||
yq 'length > 0' | tee /dev/stderr)
|
yq 'length > 0' | tee /dev/stderr)
|
||||||
[ "${actual}" = "true" ]
|
[ "${actual}" = "false" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "connectInject/Deployment: enable with global.enabled false" {
|
@test "connectInject/Deployment: enable with global.enabled false" {
|
||||||
|
@ -46,18 +46,21 @@ load _helpers
|
||||||
cd `chart_dir`
|
cd `chart_dir`
|
||||||
local actual=$(helm template \
|
local actual=$(helm template \
|
||||||
-x templates/connect-inject-deployment.yaml \
|
-x templates/connect-inject-deployment.yaml \
|
||||||
|
--set 'connectInject.enabled=true' \
|
||||||
. | tee /dev/stderr |
|
. | tee /dev/stderr |
|
||||||
yq '.spec.template.spec.containers[0].command | any(contains("-tls-cert-file"))' | tee /dev/stderr)
|
yq '.spec.template.spec.containers[0].command | any(contains("-tls-cert-file"))' | tee /dev/stderr)
|
||||||
[ "${actual}" = "false" ]
|
[ "${actual}" = "false" ]
|
||||||
|
|
||||||
local actual=$(helm template \
|
local actual=$(helm template \
|
||||||
-x templates/connect-inject-deployment.yaml \
|
-x templates/connect-inject-deployment.yaml \
|
||||||
|
--set 'connectInject.enabled=true' \
|
||||||
. | tee /dev/stderr |
|
. | tee /dev/stderr |
|
||||||
yq '.spec.template.spec.containers[0].command | any(contains("-tls-key-file"))' | tee /dev/stderr)
|
yq '.spec.template.spec.containers[0].command | any(contains("-tls-key-file"))' | tee /dev/stderr)
|
||||||
[ "${actual}" = "false" ]
|
[ "${actual}" = "false" ]
|
||||||
|
|
||||||
local actual=$(helm template \
|
local actual=$(helm template \
|
||||||
-x templates/connect-inject-deployment.yaml \
|
-x templates/connect-inject-deployment.yaml \
|
||||||
|
--set 'connectInject.enabled=true' \
|
||||||
. | tee /dev/stderr |
|
. | tee /dev/stderr |
|
||||||
yq '.spec.template.spec.containers[0].command | any(contains("-tls-auto"))' | tee /dev/stderr)
|
yq '.spec.template.spec.containers[0].command | any(contains("-tls-auto"))' | tee /dev/stderr)
|
||||||
[ "${actual}" = "true" ]
|
[ "${actual}" = "true" ]
|
||||||
|
@ -68,6 +71,7 @@ load _helpers
|
||||||
local actual=$(helm template \
|
local actual=$(helm template \
|
||||||
-x templates/connect-inject-deployment.yaml \
|
-x templates/connect-inject-deployment.yaml \
|
||||||
--set 'connectInject.certs.secretName=foo' \
|
--set 'connectInject.certs.secretName=foo' \
|
||||||
|
--set 'connectInject.enabled=true' \
|
||||||
. | tee /dev/stderr |
|
. | tee /dev/stderr |
|
||||||
yq '.spec.template.spec.containers[0].command | any(contains("-tls-cert-file"))' | tee /dev/stderr)
|
yq '.spec.template.spec.containers[0].command | any(contains("-tls-cert-file"))' | tee /dev/stderr)
|
||||||
[ "${actual}" = "true" ]
|
[ "${actual}" = "true" ]
|
||||||
|
@ -75,6 +79,7 @@ load _helpers
|
||||||
local actual=$(helm template \
|
local actual=$(helm template \
|
||||||
-x templates/connect-inject-deployment.yaml \
|
-x templates/connect-inject-deployment.yaml \
|
||||||
--set 'connectInject.certs.secretName=foo' \
|
--set 'connectInject.certs.secretName=foo' \
|
||||||
|
--set 'connectInject.enabled=true' \
|
||||||
. | tee /dev/stderr |
|
. | tee /dev/stderr |
|
||||||
yq '.spec.template.spec.containers[0].command | any(contains("-tls-key-file"))' | tee /dev/stderr)
|
yq '.spec.template.spec.containers[0].command | any(contains("-tls-key-file"))' | tee /dev/stderr)
|
||||||
[ "${actual}" = "true" ]
|
[ "${actual}" = "true" ]
|
||||||
|
@ -82,6 +87,7 @@ load _helpers
|
||||||
local actual=$(helm template \
|
local actual=$(helm template \
|
||||||
-x templates/connect-inject-deployment.yaml \
|
-x templates/connect-inject-deployment.yaml \
|
||||||
--set 'connectInject.certs.secretName=foo' \
|
--set 'connectInject.certs.secretName=foo' \
|
||||||
|
--set 'connectInject.enabled=true' \
|
||||||
. | tee /dev/stderr |
|
. | tee /dev/stderr |
|
||||||
yq '.spec.template.spec.containers[0].command | any(contains("-tls-auto"))' | tee /dev/stderr)
|
yq '.spec.template.spec.containers[0].command | any(contains("-tls-auto"))' | tee /dev/stderr)
|
||||||
[ "${actual}" = "false" ]
|
[ "${actual}" = "false" ]
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
load _helpers
|
load _helpers
|
||||||
|
|
||||||
@test "connectInject/MutatingWebhookConfiguration: enabled by default" {
|
@test "connectInject/MutatingWebhookConfiguration: disabled by default" {
|
||||||
cd `chart_dir`
|
cd `chart_dir`
|
||||||
local actual=$(helm template \
|
local actual=$(helm template \
|
||||||
-x templates/connect-inject-mutatingwebhook.yaml \
|
-x templates/connect-inject-mutatingwebhook.yaml \
|
||||||
. | tee /dev/stderr |
|
. | tee /dev/stderr |
|
||||||
yq 'length > 0' | tee /dev/stderr)
|
yq 'length > 0' | tee /dev/stderr)
|
||||||
[ "${actual}" = "true" ]
|
[ "${actual}" = "false" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "connectInject/MutatingWebhookConfiguration: enable with global.enabled false" {
|
@test "connectInject/MutatingWebhookConfiguration: enable with global.enabled false" {
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
load _helpers
|
load _helpers
|
||||||
|
|
||||||
@test "connectInject/Service: enabled by default" {
|
@test "connectInject/Service: disabled by default" {
|
||||||
cd `chart_dir`
|
cd `chart_dir`
|
||||||
local actual=$(helm template \
|
local actual=$(helm template \
|
||||||
-x templates/connect-inject-service.yaml \
|
-x templates/connect-inject-service.yaml \
|
||||||
. | tee /dev/stderr |
|
. | tee /dev/stderr |
|
||||||
yq 'length > 0' | tee /dev/stderr)
|
yq 'length > 0' | tee /dev/stderr)
|
||||||
[ "${actual}" = "true" ]
|
[ "${actual}" = "false" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "connectInject/Service: enable with global.enabled false" {
|
@test "connectInject/Service: enable with global.enabled false" {
|
||||||
|
|
Loading…
Reference in a new issue