forked from traefik/traefik-helm-chart
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhub-admission-controler_test.yaml
86 lines (86 loc) · 2.12 KB
/
hub-admission-controler_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
suite: Traefik Hub admission controller configuration
templates:
- hub-admission-controller.yaml
set:
hub:
token: xxx
apimanagement:
enabled: true
tests:
- it: should not deploy anything when hub is not enabled
set:
hub:
token: null
asserts:
- hasDocuments:
count: 0
- it: should not deploy anything when hub is not enabled
asserts:
- hasDocuments:
count: 4
- it: should not deploy anything when api management is disabled
set:
hub:
apimanagement:
enabled: false
asserts:
- hasDocuments:
count: 0
- it: should render hub-agent-cert secret
documentIndex: 0
asserts:
- isKind:
of: Secret
- equal:
path: metadata.name
value: hub-agent-cert
- it: should render hub-acp webhook
documentIndex: 1
asserts:
- isKind:
of: MutatingWebhookConfiguration
- equal:
path: metadata.name
value: hub-acp
- it: should render hub-api webhook
documentIndex: 2
asserts:
- isKind:
of: MutatingWebhookConfiguration
- equal:
path: metadata.name
value: hub-api
- it: should render admission service
documentIndex: 3
asserts:
- isKind:
of: Service
- equal:
path: metadata.name
value: admission
- it: should issue a secret with a certificate
documentIndex: 0
asserts:
- matchRegex:
path: data["tls.crt"]
pattern: .*==
- it: should issue a webhook with a certificate
documentIndex: 1
asserts:
- matchRegex:
path: webhooks[0].clientConfig.caBundle
pattern: .*==
- it: should issue a webhook with a certificate
documentIndex: 2
asserts:
- matchRegex:
path: webhooks[0].clientConfig.caBundle
pattern: .*==
- it: should issue a service with good selectors
documentIndex: 3
asserts:
- equal:
path: spec.selector
value:
app.kubernetes.io/name: traefik
app.kubernetes.io/instance: RELEASE-NAME-NAMESPACE