Skip to content

Commit 6d79743

Browse files
authored
Merge pull request #803 from jetstack/claimable-certs-unittest
Add helm unit tests for claimable certs behaviour
2 parents 3383004 + dd6fc27 commit 6d79743

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

deploy/charts/discovery-agent/tests/configmap_test.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,38 @@ tests:
7171
path: data["config.yaml"]
7272
pattern: '\^helm\\\.sh/\.\*'
7373

74+
# Test claimable certs when enabled
75+
- it: "should include 'claimable_certs: true' when claimableCerts is true"
76+
set:
77+
config.clusterName: test-cluster
78+
config.tsgID: "123456"
79+
config.claimableCerts: true
80+
asserts:
81+
- matchRegex:
82+
path: data["config.yaml"]
83+
pattern: 'claimable_certs: true'
84+
85+
# Test claimable certs when disabled
86+
- it: "should not include 'claimable_certs' when claimableCerts is false"
87+
set:
88+
config.clusterName: test-cluster
89+
config.tsgID: "123456"
90+
config.claimableCerts: false
91+
asserts:
92+
- notMatchRegex:
93+
path: data["config.yaml"]
94+
pattern: 'claimable_certs'
95+
96+
# Test claimable certs default
97+
- it: "should not include 'claimable_certs' when claimableCerts is unset"
98+
set:
99+
config.clusterName: test-cluster
100+
config.tsgID: "123456"
101+
asserts:
102+
- notMatchRegex:
103+
path: data["config.yaml"]
104+
pattern: 'claimable_certs'
105+
74106
# Test data-gatherers are present
75107
- it: should include all data-gatherers
76108
set:

0 commit comments

Comments
 (0)