Skip to content

Commit

Permalink
Update charts/ingress-nginx/tests/controller-poddisruptionbudget_test…
Browse files Browse the repository at this point in the history
….yaml

Co-authored-by: Marco Ebert <[email protected]>
  • Loading branch information
StuxxNet and Gacko authored Mar 11, 2024
1 parent 6480e14 commit 17ee81c
Showing 1 changed file with 49 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,50 @@ templates:
- controller-poddisruptionbudget.yaml

tests:
- it: should create a PodDisruptionBudget if `controller.kind` is "Deployment" and `controller.keda.enabled` is true
- it: should create a PodDisruptionBudget if `controller.replicaCount` is greater than 1
set:
controller.replicaCount: 2
asserts:
- hasDocuments:
count: 1
- isKind:
of: PodDisruptionBudget
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller

- it: should not create a PodDisruptionBudget if `controller.replicaCount` is less than or equal 1
set:
controller.replicaCount: 1
asserts:
- hasDocuments:
count: 0

- it: should create a PodDisruptionBudget if `controller.autoscaling.enabled` is true and `controller.autoscaling.minReplicas` is greater than 1
set:
controller.autoscaling.enabled: true
controller.autoscaling.minReplicas: 2
asserts:
- hasDocuments:
count: 1
- isKind:
of: PodDisruptionBudget
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller

- it: should not create a PodDisruptionBudget if `controller.autoscaling.enabled` is true and `controller.autoscaling.minReplicas` is less than or equal 1
set:
controller.autoscaling.enabled: true
controller.autoscaling.minReplicas: 1
asserts:
- hasDocuments:
count: 0

- it: should create a PodDisruptionBudget if `controller.keda.enabled` is true and `controller.keda.minReplicas` is greater than 1
set:
controller.kind: Deployment
controller.keda.enabled: true
controller.keda.minReplicas: 2
controller.minAvailable: 1
asserts:
- hasDocuments:
count: 1
Expand All @@ -17,6 +55,11 @@ tests:
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller
- equal:
path: spec.minAvailable
value: 1

- it: should not create a PodDisruptionBudget if `controller.keda.enabled` is true and `controller.keda.minReplicas` is less than or equal 1
set:
controller.keda.enabled: true
controller.keda.minReplicas: 1
asserts:
- hasDocuments:
count: 0

0 comments on commit 17ee81c

Please sign in to comment.