-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathautoscaling_runner_set_runner_pod_metadata_test.yaml
More file actions
85 lines (84 loc) · 2.73 KB
/
autoscaling_runner_set_runner_pod_metadata_test.yaml
File metadata and controls
85 lines (84 loc) · 2.73 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
suite: "AutoscalingRunnerSet runner pod metadata"
templates:
- autoscalingrunnserset.yaml
tests:
- it: should render runner.pod.metadata labels and annotations merged with common/global metadata
set:
scaleset.name: "test"
auth.url: "https://github.com/org"
auth.githubToken: "gh_token12345"
controllerServiceAccount.name: "arc"
controllerServiceAccount.namespace: "arc-system"
resource:
all:
metadata:
labels:
team: "platform"
annotations:
global-annotation: "1"
runner:
pod:
metadata:
labels:
purpose: "ci"
annotations:
pod-annotation: "2"
release:
name: "test-name"
namespace: "test-namespace"
asserts:
- equal:
path: spec.template.metadata.labels["purpose"]
value: "ci"
- equal:
path: spec.template.metadata.labels["team"]
value: "platform"
- equal:
path: spec.template.metadata.labels["app.kubernetes.io/name"]
value: "test-name"
- notEqual:
path: spec.template.metadata.labels["app.kubernetes.io/version"]
value: ""
- equal:
path: spec.template.metadata.labels["app.kubernetes.io/managed-by"]
value: "Helm"
- equal:
path: spec.template.metadata.labels["actions.github.com/scale-set-name"]
value: "test-name"
- equal:
path: spec.template.metadata.annotations["global-annotation"]
value: "1"
- equal:
path: spec.template.metadata.annotations["pod-annotation"]
value: "2"
- it: should drop reserved actions.github.com/* keys from runner.pod.metadata
set:
scaleset.name: "test"
auth.url: "https://github.com/org"
auth.githubToken: "gh_token12345"
controllerServiceAccount.name: "arc"
controllerServiceAccount.namespace: "arc-system"
runner:
pod:
metadata:
labels:
actions.github.com/scale-set-name: "should-not-override"
ok: "yes"
annotations:
actions.github.com/some-annotation: "should-not-appear"
ok-annotation: "yes"
release:
name: "test-name"
namespace: "test-namespace"
asserts:
- equal:
path: spec.template.metadata.labels["actions.github.com/scale-set-name"]
value: "test-name"
- equal:
path: spec.template.metadata.labels["ok"]
value: "yes"
- notExists:
path: spec.template.metadata.annotations["actions.github.com/some-annotation"]
- equal:
path: spec.template.metadata.annotations["ok-annotation"]
value: "yes"