forked from traefik/traefik-helm-chart
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhpa-config_test.yaml
39 lines (39 loc) · 924 Bytes
/
hpa-config_test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
suite: HPA configuration
templates:
- hpa.yaml
capabilities:
majorVersion: 1
minorVersion: 23
tests:
- it: should use autoscaling/v2 when k8s >= 1.23
values:
- ./values/hpa.yaml
asserts:
- isAPIVersion:
of: autoscaling/v2
- it: should use autoscaling/v2beta2 when k8s < 1.23
capabilities:
majorVersion: 1
minorVersion: 22
values:
- ./values/hpa.yaml
asserts:
- isAPIVersion:
of: autoscaling/v2beta2
- it: should fail without maxReplicas
set:
autoscaling:
enabled: true
asserts:
- failedTemplate:
errorMessage: "ERROR: maxReplicas is required on HPA"
- it: should not contains metrics nor behavior when they are not set
set:
autoscaling:
enabled: true
maxReplicas: 3
asserts:
- isNull:
path: spec.metrics
- isNull:
path: spec.behavior