Skip to content

Commit 96a52ca

Browse files
test: Fix assertion
1 parent 7a0f32b commit 96a52ca

1 file changed

Lines changed: 128 additions & 0 deletions

File tree

tests/templates/kuttl/smoke/10-assert.yaml.j2

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,70 @@ spec:
175175
- mountPath: {{ test_scenario['values']['opensearch_home'] }}/config/tls
176176
name: tls
177177
readOnly: true
178+
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
179+
- args:
180+
- |-
181+
# Vector will ignore SIGTERM (as PID != 1) and must be shut down by writing a shutdown trigger file
182+
vector & vector_pid=$!
183+
if [ ! -f "/stackable/log/_vector/shutdown" ]; then
184+
mkdir -p /stackable/log/_vector
185+
inotifywait -qq --event create /stackable/log/_vector;
186+
fi
187+
sleep 1
188+
kill $vector_pid
189+
command:
190+
- /bin/bash
191+
- -x
192+
- -euo
193+
- pipefail
194+
- -c
195+
env:
196+
- name: CLUSTER_NAME
197+
value: opensearch
198+
- name: LOG_DIR
199+
value: /stackable/log
200+
- name: NAMESPACE
201+
valueFrom:
202+
fieldRef:
203+
apiVersion: v1
204+
fieldPath: metadata.namespace
205+
- name: OPENSEARCH_SERVER_LOG_FILE
206+
value: opensearch_server.json
207+
- name: ROLE_GROUP_NAME
208+
value: cluster-manager
209+
- name: ROLE_NAME
210+
value: nodes
211+
- name: VECTOR_AGGREGATOR_ADDRESS
212+
valueFrom:
213+
configMapKeyRef:
214+
key: ADDRESS
215+
name: vector-aggregator-discovery
216+
- name: VECTOR_CONFIG_YAML
217+
value: /stackable/config/vector.yaml
218+
- name: VECTOR_FILE_LOG_LEVEL
219+
value: info
220+
- name: VECTOR_LOG
221+
value: info
222+
image: oci.stackable.tech/sdp/opensearch:3.1.0-stackable0.0.0-dev
223+
imagePullPolicy: IfNotPresent
224+
name: vector
225+
resources:
226+
limits:
227+
cpu: 500m
228+
memory: 128Mi
229+
requests:
230+
cpu: 250m
231+
memory: 128Mi
232+
terminationMessagePath: /dev/termination-log
233+
terminationMessagePolicy: File
234+
volumeMounts:
235+
- mountPath: /stackable/config/vector.yaml
236+
name: config
237+
readOnly: true
238+
subPath: vector.yaml
239+
- mountPath: /stackable/log
240+
name: log
241+
{% endif %}
178242
securityContext:
179243
fsGroup: 1000
180244
serviceAccount: opensearch-serviceaccount
@@ -423,6 +487,70 @@ spec:
423487
- mountPath: {{ test_scenario['values']['opensearch_home'] }}/config/tls
424488
name: tls
425489
readOnly: true
490+
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
491+
- args:
492+
- |-
493+
# Vector will ignore SIGTERM (as PID != 1) and must be shut down by writing a shutdown trigger file
494+
vector & vector_pid=$!
495+
if [ ! -f "/stackable/log/_vector/shutdown" ]; then
496+
mkdir -p /stackable/log/_vector
497+
inotifywait -qq --event create /stackable/log/_vector;
498+
fi
499+
sleep 1
500+
kill $vector_pid
501+
command:
502+
- /bin/bash
503+
- -x
504+
- -euo
505+
- pipefail
506+
- -c
507+
env:
508+
- name: CLUSTER_NAME
509+
value: opensearch
510+
- name: LOG_DIR
511+
value: /stackable/log
512+
- name: NAMESPACE
513+
valueFrom:
514+
fieldRef:
515+
apiVersion: v1
516+
fieldPath: metadata.namespace
517+
- name: OPENSEARCH_SERVER_LOG_FILE
518+
value: opensearch_server.json
519+
- name: ROLE_GROUP_NAME
520+
value: data
521+
- name: ROLE_NAME
522+
value: nodes
523+
- name: VECTOR_AGGREGATOR_ADDRESS
524+
valueFrom:
525+
configMapKeyRef:
526+
key: ADDRESS
527+
name: vector-aggregator-discovery
528+
- name: VECTOR_CONFIG_YAML
529+
value: /stackable/config/vector.yaml
530+
- name: VECTOR_FILE_LOG_LEVEL
531+
value: info
532+
- name: VECTOR_LOG
533+
value: info
534+
image: oci.stackable.tech/sdp/opensearch:3.1.0-stackable0.0.0-dev
535+
imagePullPolicy: IfNotPresent
536+
name: vector
537+
resources:
538+
limits:
539+
cpu: 500m
540+
memory: 128Mi
541+
requests:
542+
cpu: 250m
543+
memory: 128Mi
544+
terminationMessagePath: /dev/termination-log
545+
terminationMessagePolicy: File
546+
volumeMounts:
547+
- mountPath: /stackable/config/vector.yaml
548+
name: config
549+
readOnly: true
550+
subPath: vector.yaml
551+
- mountPath: /stackable/log
552+
name: log
553+
{% endif %}
426554
securityContext:
427555
fsGroup: 1000
428556
serviceAccount: opensearch-serviceaccount

0 commit comments

Comments
 (0)