forked from traefik/traefik-helm-chart
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdashboard-ingressroute_test.yaml
131 lines (131 loc) · 2.91 KB
/
dashboard-ingressroute_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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
suite: Dashboard IngressRoute configuration
templates:
- ingressroute.yaml
set:
ingressRoute:
dashboard:
enabled: true
tests:
- it: should allow disabling dashboard exposure using ingressRoute
set:
ingressRoute:
dashboard:
enabled: false
asserts:
- hasDocuments:
count: 0
- it: should have the expected default
asserts:
- equal:
path: spec.routes[0].match
value: PathPrefix(`/dashboard`) || PathPrefix(`/api`)
- equal:
path: metadata.name
value: RELEASE-NAME-dashboard
- it: should support overwriting the route match rule
set:
ingressRoute:
dashboard:
matchRule: Host(`traefik.example.com`)
asserts:
- equal:
path: spec.routes[0].match
value: Host(`traefik.example.com`)
- it: should have traefik as default entryPoints
asserts:
- equal:
path: spec.entryPoints
value: ["traefik"]
- it: should support setting websecure as entryPoint
set:
ingressRoute:
dashboard:
entryPoints: ["websecure"]
asserts:
- equal:
path: spec.entryPoints
value: ["websecure"]
- it: should support adding specific label on IngressRoute
set:
ingressRoute:
dashboard:
labels:
foo: bar
asserts:
- equal:
path: metadata.labels.foo
value: bar
- it: should not have middlewares by default
asserts:
- isNull:
path: spec.routes[0].middlewares
- it: should support adding middlewares
set:
ingressRoute:
dashboard:
middlewares:
- name: traefik-dashboard-auth
namespace: default
asserts:
- equal:
path: spec.routes[0].middlewares
value:
- name: traefik-dashboard-auth
namespace: default
- it: should not have tls options by default
asserts:
- isNull:
path: spec.tls
- it: should support adding tls options
set:
ingressRoute:
dashboard:
tls:
secretName: traefik-dashboard-auth
options:
name: tls-options
namespace: default
asserts:
- equal:
path: spec.tls
value:
secretName: traefik-dashboard-auth
options:
name: tls-options
namespace: default
- it: should not set default ingress class annotation
set:
ingressRoute:
dashboard:
enabled: true
asserts:
- equal:
path: metadata.annotations
value: null
- it: should use the ingress class name for the annotation
set:
ingressRoute:
dashboard:
enabled: true
providers:
kubernetesCRD:
ingressClass: test-class
asserts:
- equal:
path: metadata.annotations
value:
kubernetes.io/ingress.class: test-class
- it: should insert annotations correctly
set:
ingressRoute:
dashboard:
enabled: true
annotations:
foo: bar
fis: fas
asserts:
- equal:
path: metadata.annotations
value:
foo: bar
fis: fas