Apply suggestions from code review

Co-authored-by: Marco Ebert <marco_ebert@icloud.com>
This commit is contained in:
Stavros Foteinopoulos 2023-12-13 18:35:27 +02:00 committed by GitHub
parent 31d8e1252d
commit dba21b6c77
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 45 additions and 27 deletions

View file

@ -11,3 +11,6 @@ tests:
count: 1
- isKind:
of: DaemonSet
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller

View file

@ -9,8 +9,11 @@ tests:
count: 1
- isKind:
of: Deployment
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller
- it: should create a Deployment with 3 replicas when `controller.replicaCount` is 3
- it: should create a Deployment with 3 replicas if `controller.replicaCount` is 3
set:
controller.replicaCount: 3
asserts:
@ -18,7 +21,7 @@ tests:
path: spec.replicas
value: 3
- it: should create a Deployment with resource limits when `controller.resources.limits` is set
- it: should create a Deployment with resource limits if `controller.resources.limits` is set
set:
controller.resources.limits.cpu: 500m
controller.resources.limits.memory: 512Mi

View file

@ -3,13 +3,15 @@ templates:
- controller-hpa.yaml
tests:
- it: should create an hpa when controller kind is Deployment and autoscaling is enabled
- it: should create a HPA if `controller.kind` is "Deployment" and `controller.autoscaling.enabled` is true
set:
controller.kind: Deployment
controller.autoscaling.enabled: true
controller.keda.enabled: false
asserts:
- hasDocuments:
count: 1
- isKind:
of: HorizontalPodAutoscaler
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller

View file

@ -1,9 +1,9 @@
suite: test controller keda
suite: Controller > KEDA
templates:
- controller-keda.yaml
tests:
- it: should create a keda scaled object when controller kind is Deployment and keda is enabled
- it: should create a ScaledObject if `controller.kind` is "Deployment" and `controller.keda.enabled` is true
set:
controller.kind: Deployment
controller.keda.enabled: true
@ -12,3 +12,6 @@ tests:
count: 1
- isKind:
of: ScaledObject
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller

View file

@ -1,16 +1,16 @@
suite: test controller network policy
suite: Controller > NetworkPolicy
templates:
- controller-networkpolicy.yaml
tests:
- it: should not create a network policy by default
- it: should not create a NetworkPolicy if `controller.networkPolicy.enabled` is false
set:
controller.networkPolicy.enabled: false
asserts:
- hasDocuments:
count: 0
- it: should create a network policy when enabled
- it: should create a NetworkPolicy if `controller.networkPolicy.enabled` is true
set:
controller.networkPolicy.enabled: true
asserts:
@ -18,3 +18,6 @@ tests:
count: 1
- isKind:
of: NetworkPolicy
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller

View file

@ -1,19 +1,17 @@
suite: test controller internal service
suite: Controller > Service > Internal
templates:
- controller-service-internal.yaml
tests:
- it: should not create an internal service by default
- it: should not create an internal Service if `controller.service.internal.enabled` is false
set:
controller.service.enabled: true
controller.service.internal.enabled: false
asserts:
- hasDocuments:
count: 0
- it: should create an internal service when enabled
- it: should create an internal Service if `controller.service.internal.enabled` is true and `controller.service.internal.annotations` are set
set:
controller.service.enabled: true
controller.service.internal.enabled: true
controller.service.internal.annotations:
test.annotation: "true"
@ -22,3 +20,6 @@ tests:
count: 1
- isKind:
of: Service
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller-internal

View file

@ -1,16 +1,16 @@
suite: test controller metrics service
suite: Controller > Service > Metrics
templates:
- controller-service-metrics.yaml
tests:
- it: should not create a metrics service by default
- it: should not create a metrics Service if `controller.metrics.enabled` is false
set:
controller.metrics.enabled: false
asserts:
- hasDocuments:
count: 0
- it: should create a metrics service when enabled
- it: should create a metrics Service if `controller.metrics.enabled` is true
set:
controller.metrics.enabled: true
asserts:
@ -18,3 +18,6 @@ tests:
count: 1
- isKind:
of: Service
- equal:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller-metrics

View file

@ -1,18 +1,18 @@
suite: test controller service
suite: Controller > Service
templates:
- controller-service.yaml
tests:
- it: should not create any service by default
- it: should not create a Service if `controller.service.external.enabled` is false
set:
controller.service.enabled: false
controller.service.external.enabled: false
asserts:
- hasDocuments:
count: 0
- it: should create a service when enabled
- it: should create a Service if `controller.service.external.enabled` is true
set:
controller.service.enabled: true
controller.service.external.enabled: true
asserts:
- hasDocuments:
count: 1
@ -22,7 +22,7 @@ tests:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-controller
- it: custom service type
- it: should create a Service of type "NodePort" if `controller.service.external.enabled` is true and `controller.service.type` is "NodePort"
set:
controller.service.enabled: true
controller.service.type: NodePort

View file

@ -1,16 +1,16 @@
suite: test default backend service
suite: Default Backend > Service
templates:
- default-backend-service.yaml
tests:
- it: should not create any default backend service by default
- it: should not create a Service if `defaultBackend.enabled` is false
set:
defaultBackend.enabled: false
asserts:
- hasDocuments:
count: 0
- it: should create a default backend service when enabled
- it: should create a Service if `defaultBackend.enabled` is true
set:
defaultBackend.enabled: true
asserts:
@ -22,7 +22,7 @@ tests:
path: metadata.name
value: RELEASE-NAME-ingress-nginx-defaultbackend
- it: verify service port configuration
- it: should create a Service with port 80 if `defaultBackend.service.port` is 80
set:
defaultBackend.enabled: true
defaultBackend.service.port: 80