From bb4a5d48b4f63d7e36d46116021fe85a04c1537f Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Tue, 26 Nov 2024 19:55:15 +0100 Subject: [PATCH] test(deployment): topologySpreadConstraints --- unittests/deployment/deployment.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/unittests/deployment/deployment.yaml b/unittests/deployment/deployment.yaml index 2a37088..d545588 100644 --- a/unittests/deployment/deployment.yaml +++ b/unittests/deployment/deployment.yaml @@ -88,6 +88,8 @@ tests: value: 60 - notExists: path: spec.template.spec.tolerations + - notExists: + path: spec.template.spec.topologySpreadConstraints - it: Test additional arguments set: @@ -322,6 +324,24 @@ tests: value: postgres effect: NoSchedule +- it: Test topologySpreadConstraints + set: + deployment.topologySpreadConstraints: + - topologyKey: kubernetes.io/hostname + whenUnsatisfiable: DoNotSchedule + labelSelector: + matchLabels: + app.kubernetes.io/instance: prometheus-postgres-exporter + asserts: + - equal: + path: spec.template.spec.topologySpreadConstraints + value: + - topologyKey: kubernetes.io/hostname + whenUnsatisfiable: DoNotSchedule + labelSelector: + matchLabels: + app.kubernetes.io/instance: prometheus-postgres-exporter + - it: Test additional volumeMounts and volumes set: deployment.postgresExporter.volumeMounts: