11---
2- apiVersion: v1
3- kind: ConfigMap
4- metadata:
5- name: test
6- labels:
7- opa.stackable.tech/bundle: "true"
8- data:
9- test.rego: |
10- package test
2+ apiVersion: kuttl.dev/v1beta1
3+ kind: TestStep
4+ commands:
5+ - script: |
6+ kubectl apply -n $NAMESPACE -f - <<EOF
7+ ---
8+ apiVersion: v1
9+ kind: ConfigMap
10+ metadata:
11+ name: test
12+ labels:
13+ opa.stackable.tech /bundle: " true"
14+ data:
15+ test.rego: |
16+ package test
1117
12- hello if {
13- true
14- }
18+ hello if {
19+ true
20+ }
1521
16- world if {
17- false
18- }
19- ---
20- apiVersion: opa.stackable.tech/v1alpha1
21- kind: OpaCluster
22- metadata:
23- name: test-opa-https
24- spec:
25- image:
22+ world if {
23+ false
24+ }
25+ ---
26+ apiVersion: opa.stackable.tech /v1alpha1
27+ kind: OpaCluster
28+ metadata:
29+ name: test-opa
30+ spec:
31+ image:
2632{% if test_scenario[ ' values' ][ ' opa' ].find( " ," ) > 0 %}
27- custom: "{{ test_scenario['values'] ['opa'] .split(',')[1] }}"
28- productVersion: "{{ test_scenario['values'] ['opa'] .split(',')[0] }}"
33+ custom: "{{ test_scenario['values'] ['opa'] .split(',')[1] }}"
34+ productVersion: "{{ test_scenario['values'] ['opa'] .split(',')[0] }}"
2935{% else %}
30- productVersion: "{{ test_scenario['values'] ['opa'] }}"
31- {% endif %}
32- pullPolicy: IfNotPresent
33- clusterConfig:
34- tls:
35- serverSecretClass: opa-tls-$NAMESPACE
36- {% if lookup ('env' , 'VECTOR_AGGREGATOR' ) %}
37- vectorAggregatorConfigMapName: vector-aggregator-discovery
36+ productVersion: "{{ test_scenario['values'] ['opa'] }}"
3837{% endif %}
39- servers:
40- config:
41- logging:
42- enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
43- envOverrides:
44- SERVER_ROLE_LEVEL_ENV_VAR: "SERVER_ROLE_LEVEL_ENV_VAR"
45- roleGroups:
46- default:
47- envOverrides:
48- SERVER_ROLE_GROUP_LEVEL_ENV_VAR: "SERVER_ROLE_GROUP_LEVEL_ENV_VAR"
49- ---
50- apiVersion: opa.stackable.tech/v1alpha1
51- kind: OpaCluster
52- metadata:
53- name: test-opa-http
54- spec:
55- image:
56- {% if test_scenario ['values' ]['opa' ].find ("," ) > 0 %}
57- custom: "{{ test_scenario['values'] ['opa'] .split(',')[1] }}"
58- productVersion: "{{ test_scenario['values'] ['opa'] .split(',')[0] }}"
59- {% else %}
60- productVersion: "{{ test_scenario['values'] ['opa'] }}"
38+ pullPolicy: IfNotPresent
39+ clusterConfig:
40+ {% if test_scenario ['values' ]['use-tls' ] == "true" %}
41+ tls:
42+ serverSecretClass: opa-tls-$NAMESPACE
6143{% endif %}
62- pullPolicy: IfNotPresent
63- clusterConfig:
6444{% if lookup ('env' , 'VECTOR_AGGREGATOR' ) %}
65- vectorAggregatorConfigMapName: vector-aggregator-discovery
45+ vectorAggregatorConfigMapName: vector-aggregator-discovery
6646{% endif %}
67- servers:
68- config:
69- logging:
70- enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
71- envOverrides:
72- SERVER_ROLE_LEVEL_ENV_VAR: "SERVER_ROLE_LEVEL_ENV_VAR"
73- roleGroups:
74- default:
75- envOverrides:
76- SERVER_ROLE_GROUP_LEVEL_ENV_VAR: "SERVER_ROLE_GROUP_LEVEL_ENV_VAR"
47+ servers:
48+ config:
49+ logging:
50+ enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
51+ envOverrides:
52+ SERVER_ROLE_LEVEL_ENV_VAR: "SERVER_ROLE_LEVEL_ENV_VAR"
53+ roleGroups:
54+ default:
55+ envOverrides:
56+ SERVER_ROLE_GROUP_LEVEL_ENV_VAR: "SERVER_ROLE_GROUP_LEVEL_ENV_VAR"
57+ EOF
0 commit comments