From 7d59f83f7d9224c5ecdb2b29f200cda97910e3a7 Mon Sep 17 00:00:00 2001 From: smerle33 Date: Tue, 3 Oct 2023 15:35:50 +0200 Subject: [PATCH] add custom test values for pdb --- charts/reports/tests/custom_values_test.yaml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/charts/reports/tests/custom_values_test.yaml b/charts/reports/tests/custom_values_test.yaml index a924a5829..a53734058 100644 --- a/charts/reports/tests/custom_values_test.yaml +++ b/charts/reports/tests/custom_values_test.yaml @@ -29,18 +29,34 @@ tests: - equal: path: spec.template.spec.volumes[0].hostPath value: /host + - it: should create a PDB with defaults when multiple replicas are set + template: pdb.yaml + set: + replicaCount: 2 + asserts: + - isKind: + of: PodDisruptionBudget + - equal: + path: spec.minAvailable + value: 1 + - equal: + path: spec.selector.matchLabels['app.kubernetes.io/name'] + value: "reports" - it: should ensure the pdb has correct spec template: pdb.yaml set: replicaCount: 2 poddisruptionbudget.minAvailable: 2 - poddisruptionbudget.maxUnavailable: 1 + poddisruptionbudget.maxUnavailable: 3 asserts: - isKind: of: PodDisruptionBudget - equal: path: spec.minAvailable value: 2 + - equal: + path: spec.maxUnavailable + value: 3 - equal: path: spec.selector.matchLabels['app.kubernetes.io/name'] value: "reports"