
Test with latest kind k8s versions 1.22-1.26. Remove support for old disruptionbudget and ingress APIs (pre 1.22). Pin all actions to SHAs, and use the common jira sync. Update the default Vault version to v1.13.1. Update chart-verifier used in tests to 1.10.1, also add an openshift name annotation to Chart.yaml (one of the required checks).
43 lines
1.5 KiB
Bash
Executable file
43 lines
1.5 KiB
Bash
Executable file
#!/usr/bin/env bats
|
|
|
|
load _helpers
|
|
|
|
@test "injector/DisruptionBudget: disabled by default" {
|
|
cd `chart_dir`
|
|
local actual=$( (helm template \
|
|
--show-only templates/injector-disruptionbudget.yaml \
|
|
. || echo "---") | tee /dev/stderr |
|
|
yq 'length > 0' | tee /dev/stderr)
|
|
[ "${actual}" = "false" ]
|
|
}
|
|
|
|
@test "injector/DisruptionBudget: configure with injector.podDisruptionBudget minAvailable" {
|
|
cd `chart_dir`
|
|
local actual=$(helm template \
|
|
--show-only templates/injector-disruptionbudget.yaml \
|
|
--set 'injector.podDisruptionBudget.minAvailable=2' \
|
|
. | tee /dev/stderr |
|
|
yq '.spec.minAvailable == 2' | tee /dev/stderr)
|
|
[ "${actual}" = "true" ]
|
|
}
|
|
|
|
@test "injector/DisruptionBudget: configure with injector.podDisruptionBudget maxUnavailable" {
|
|
cd `chart_dir`
|
|
local actual=$(helm template \
|
|
--show-only templates/injector-disruptionbudget.yaml \
|
|
--set 'injector.podDisruptionBudget.maxUnavailable=3' \
|
|
. | tee /dev/stderr |
|
|
yq '.spec.maxUnavailable == 3' | tee /dev/stderr)
|
|
[ "${actual}" = "true" ]
|
|
}
|
|
|
|
@test "injector/DisruptionBudget: apiVersion is set correctly >= version 1.21 of kube" {
|
|
cd `chart_dir`
|
|
local actual=$(helm template \
|
|
--show-only templates/injector-disruptionbudget.yaml \
|
|
--set 'injector.podDisruptionBudget.minAvailable=2' \
|
|
--kube-version 1.22.5 \
|
|
. | tee /dev/stderr |
|
|
yq '.apiVersion == "policy/v1"' | tee /dev/stderr)
|
|
[ "${actual}" = "true" ]
|
|
}
|