Skip to content

Commit 143c059

Browse files
committed
add test for dnsConfig and dnsPolicy
1 parent 5c864c5 commit 143c059

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* Advanced Feature: Make securityContext (on Deployments/Jobs) and podSecurityContext (on Pods) configurable. This allows dropping all capabilities, for example. You can override the securityContext for `st2actionrunner`, `st2sensorcontainer`, and `st2client` if your actions or sensors need, for example, additional capabilites that the rest of StackStorm does not need. (#271) (by @cognifloyd)
55
* Prefix template helpers with chart name and format helper comments as template comments. (#272) (by @cognifloyd)
66
* New feature: Add `extra_volumes` to all python-based st2 deployments. This can facilitate changing log levels by loading logging conf file(s) from a custom ConfigMap. (#276) (by @cognifloyd)
7-
* Initialize basic unittest infrastructure using `helm-unittest`. Added tests for labels, custom annotations, SecurityContext, pullSecrets, pullPolicy, Resources, nodeSelector, tolerations, and affinity. (#284, #288)
7+
* Initialize basic unittest infrastructure using `helm-unittest`. Added tests for labels, custom annotations, SecurityContext, pullSecrets, pullPolicy, Resources, nodeSelector, tolerations, affinity, dnsPolicy, and dnsConfig. (#284, #288)
88

99
## v0.80.0
1010
* Switch st2 to `v3.6` as a new default stable version (#274)

tests/unit/dns_test.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
suite: DNS
3+
templates:
4+
# primary template files
5+
- deployments.yaml
6+
- jobs.yaml
7+
8+
# included templates must also be listed
9+
- configmaps_packs.yaml
10+
- configmaps_rbac.yaml
11+
- configmaps_st2-conf.yaml
12+
- configmaps_st2-urls.yaml
13+
- configmaps_st2web.yaml
14+
- secrets_datastore_crypto_key.yaml
15+
- secrets_ssh.yaml
16+
- secrets_st2apikeys.yaml
17+
- secrets_st2auth.yaml
18+
- secrets_st2chatops.yaml
19+
20+
# relevant values:
21+
# dnsPolicy:
22+
# dnsConfig:
23+
24+
tests:
25+
- it: Deployments and Jobs default to no dnsPolicy or dnsConfig
26+
templates:
27+
- deployments.yaml
28+
- jobs.yaml
29+
set:
30+
st2:
31+
packs: { sensors: [] } # ensure only 1 sensor
32+
rbac: { enabled: true } # enable rbac job
33+
asserts:
34+
- isNull:
35+
path: spec.template.spec.dnsPolicy
36+
- isNull:
37+
path: spec.template.spec.dnsConfig
38+
39+
- it: Deployments and Jobs accept custom dnsPolicy or dnsConfig
40+
templates:
41+
- deployments.yaml
42+
- jobs.yaml
43+
set:
44+
dnsPolicy: &dnsPolicy ClusterFirstWithHostNet
45+
dnsConfig: &dnsConfig
46+
nameservers:
47+
- 1.2.3.4
48+
searches:
49+
- ns1.svc.cluster-domain.example
50+
- my.dns.search.suffix
51+
options:
52+
- name: ndots
53+
value: "2"
54+
- name: edns0
55+
st2:
56+
packs: { sensors: [] } # ensure only 1 sensor
57+
rbac: { enabled: true } # enable rbac job
58+
asserts:
59+
- equal:
60+
path: spec.template.spec.dnsPolicy
61+
value: *dnsPolicy
62+
- equal:
63+
path: spec.template.spec.dnsConfig
64+
value: *dnsConfig

0 commit comments

Comments
 (0)