-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathautoscaling_runner_set_annotations_test.yaml
More file actions
148 lines (145 loc) · 4.43 KB
/
autoscaling_runner_set_annotations_test.yaml
File metadata and controls
148 lines (145 loc) · 4.43 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
suite: "Test AutoscalingRunnerSet Annotations"
templates:
- autoscalingrunnserset.yaml
tests:
- it: should render values-hash annotation
set:
scaleset.name: "test"
auth.url: "https://github.com/org"
auth.githubToken: "gh_token12345"
controllerServiceAccount.name: "arc"
controllerServiceAccount.namespace: "arc-system"
release:
name: "test-name"
namespace: "test-namespace"
asserts:
- exists:
path: metadata.annotations["actions.github.com/values-hash"]
- it: should merge global and resource annotations (resource overrides global)
set:
scaleset.name: "test"
auth.url: "https://github.com/org"
auth.githubToken: "gh_token12345"
controllerServiceAccount.name: "arc"
controllerServiceAccount.namespace: "arc-system"
resource:
all:
metadata:
annotations:
a: "global"
shared: "global"
autoscalingRunnerSet:
metadata:
annotations:
b: "resource"
shared: "resource"
release:
name: "test-name"
namespace: "test-namespace"
asserts:
- equal:
path: metadata.annotations.a
value: "global"
- equal:
path: metadata.annotations.b
value: "resource"
- equal:
path: metadata.annotations.shared
value: "resource"
- it: should not allow overriding reserved values-hash annotation
set:
scaleset.name: "test"
auth.url: "https://github.com/org"
auth.githubToken: "gh_token12345"
controllerServiceAccount.name: "arc"
controllerServiceAccount.namespace: "arc-system"
resource:
all:
metadata:
annotations:
actions.github.com/values-hash: "user-value"
ok: "ok"
autoscalingRunnerSet:
metadata:
annotations:
actions.github.com/cleanup-something: "should-not-render"
release:
name: "test-name"
namespace: "test-namespace"
asserts:
- equal:
path: metadata.annotations.ok
value: "ok"
- notEqual:
path: metadata.annotations["actions.github.com/values-hash"]
value: "user-value"
- notExists:
path: metadata.annotations["actions.github.com/cleanup-something"]
- it: should render internal resource metadata annotations in autoscaling runner set spec
set:
scaleset.name: "test"
auth.url: "https://github.com/org"
auth.githubToken: "gh_token12345"
controllerServiceAccount.name: "arc"
controllerServiceAccount.namespace: "arc-system"
resource:
autoscalingListener:
metadata:
annotations:
listener: "true"
listenerServiceAccount:
metadata:
annotations:
service-account: "true"
listenerRole:
metadata:
annotations:
role: "true"
listenerRoleBinding:
metadata:
annotations:
role-binding: "true"
listenerConfigSecret:
metadata:
annotations:
config-secret: "true"
ephemeralRunnerSet:
metadata:
annotations:
runner-set: "true"
ephemeralRunner:
metadata:
annotations:
runner: "true"
ephemeralRunnerConfigSecret:
metadata:
annotations:
runner-secret: "true"
release:
name: "test-name"
namespace: "test-namespace"
asserts:
- equal:
path: spec.autoscalingListener.annotations.listener
value: "true"
- equal:
path: spec.listenerServiceAccountMetadata.annotations.service-account
value: "true"
- equal:
path: spec.listenerRoleMetadata.annotations.role
value: "true"
- equal:
path: spec.listenerRoleBindingMetadata.annotations.role-binding
value: "true"
- equal:
path: spec.listenerConfigSecretMetadata.annotations.config-secret
value: "true"
- equal:
path: spec.ephemeralRunnerSetMetadata.annotations.runner-set
value: "true"
- equal:
path: spec.ephemeralRunnerMetadata.annotations.runner
value: "true"
- equal:
path: spec.ephemeralRunnerConfigSecretMetadata.annotations.runner-secret
value: "true"