1+ suite : Test Default Environment Variables
2+ templates :
3+ - hyperdx-deployment.yaml
4+ tests :
5+ - it : should add DEFAULT_CONNECTIONS env var when configured with secrets
6+ set :
7+ hyperdx :
8+ env :
9+ - name : DEFAULT_CONNECTIONS
10+ valueFrom :
11+ secretKeyRef :
12+ name : hyperdx-connections
13+ key : connections-json
14+ asserts :
15+ - contains :
16+ path : spec.template.spec.containers[0].env
17+ content :
18+ name : DEFAULT_CONNECTIONS
19+ valueFrom :
20+ secretKeyRef :
21+ name : hyperdx-connections
22+ key : connections-json
23+
24+ - it : should add DEFAULT_SOURCES env var when configured with plain value
25+ set :
26+ hyperdx :
27+ env :
28+ - name : DEFAULT_SOURCES
29+ value : ' [{"name":"HyperDX Logs","kind":"log","connection":"Local ClickHouse"}]'
30+ asserts :
31+ - contains :
32+ path : spec.template.spec.containers[0].env
33+ content :
34+ name : DEFAULT_SOURCES
35+ value : ' [{"name":"HyperDX Logs","kind":"log","connection":"Local ClickHouse"}]'
36+
37+ - it : should add DEFAULT_SOURCES env var when configured with secrets
38+ set :
39+ hyperdx :
40+ env :
41+ - name : DEFAULT_SOURCES
42+ valueFrom :
43+ secretKeyRef :
44+ name : hyperdx-sources
45+ key : sources-json
46+ asserts :
47+ - contains :
48+ path : spec.template.spec.containers[0].env
49+ content :
50+ name : DEFAULT_SOURCES
51+ valueFrom :
52+ secretKeyRef :
53+ name : hyperdx-sources
54+ key : sources-json
55+
56+ - it : should add both DEFAULT_CONNECTIONS and DEFAULT_SOURCES when configured
57+ set :
58+ hyperdx :
59+ env :
60+ - name : DEFAULT_CONNECTIONS
61+ valueFrom :
62+ secretKeyRef :
63+ name : hyperdx-connections
64+ key : connections-json
65+ - name : DEFAULT_SOURCES
66+ valueFrom :
67+ secretKeyRef :
68+ name : hyperdx-sources
69+ key : sources-json
70+ asserts :
71+ - contains :
72+ path : spec.template.spec.containers[0].env
73+ content :
74+ name : DEFAULT_CONNECTIONS
75+ valueFrom :
76+ secretKeyRef :
77+ name : hyperdx-connections
78+ key : connections-json
79+ - contains :
80+ path : spec.template.spec.containers[0].env
81+ content :
82+ name : DEFAULT_SOURCES
83+ valueFrom :
84+ secretKeyRef :
85+ name : hyperdx-sources
86+ key : sources-json
87+
88+ - it : should include DEFAULT_CONNECTIONS and DEFAULT_SOURCES by default
89+ asserts :
90+ - isNotEmpty :
91+ path : spec.template.spec.containers[0].env[?(@.name=="DEFAULT_CONNECTIONS")]
92+ - isNotEmpty :
93+ path : spec.template.spec.containers[0].env[?(@.name=="DEFAULT_SOURCES")]
94+
95+ - it : should not include DEFAULT_CONNECTIONS when set to empty string
96+ set :
97+ hyperdx :
98+ defaultConnections : " "
99+ asserts :
100+ - notContains :
101+ path : spec.template.spec.containers[0].env
102+ content :
103+ name : DEFAULT_CONNECTIONS
104+
105+ - it : should not include DEFAULT_SOURCES when set to empty string
106+ set :
107+ hyperdx :
108+ defaultSources : " "
109+ asserts :
110+ - notContains :
111+ path : spec.template.spec.containers[0].env
112+ content :
113+ name : DEFAULT_SOURCES
114+
115+ - it : should work with multiline JSON value for DEFAULT_SOURCES
116+ set :
117+ hyperdx :
118+ env :
119+ - name : DEFAULT_SOURCES
120+ value : |
121+ [
122+ {
123+ "name": "HyperDX Logs",
124+ "kind": "log",
125+ "connection": "Local ClickHouse",
126+ "from": {
127+ "databaseName": "default",
128+ "tableName": "logs"
129+ }
130+ }
131+ ]
132+ asserts :
133+ - contains :
134+ path : spec.template.spec.containers[0].env
135+ content :
136+ name : DEFAULT_SOURCES
137+ value : |
138+ [
139+ {
140+ "name": "HyperDX Logs",
141+ "kind": "log",
142+ "connection": "Local ClickHouse",
143+ "from": {
144+ "databaseName": "default",
145+ "tableName": "logs"
146+ }
147+ }
148+ ]
0 commit comments