diff --git a/tests/templates/kuttl/cluster-operation/20-stop-trino.yaml.j2 b/tests/templates/kuttl/cluster-operation/20-stop-trino.yaml.j2 index fdda1278..c017e975 100644 --- a/tests/templates/kuttl/cluster-operation/20-stop-trino.yaml.j2 +++ b/tests/templates/kuttl/cluster-operation/20-stop-trino.yaml.j2 @@ -4,33 +4,6 @@ kind: TrinoCluster metadata: name: trino spec: - image: -{% if test_scenario['values']['trino-latest'].find(",") > 0 %} - custom: "{{ test_scenario['values']['trino-latest'].split(',')[1] }}" - productVersion: "{{ test_scenario['values']['trino-latest'].split(',')[0] }}" -{% else %} - productVersion: "{{ test_scenario['values']['trino-latest'] }}" -{% endif %} - pullPolicy: IfNotPresent - clusterConfig: - catalogLabelSelector: {} -{% if lookup('env', 'VECTOR_AGGREGATOR') %} - vectorAggregatorConfigMapName: vector-aggregator-discovery -{% endif %} clusterOperation: stopped: true reconciliationPaused: false - coordinators: - config: - logging: - enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} - roleGroups: - default: - replicas: 1 - workers: - config: - logging: - enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} - roleGroups: - default: - replicas: 1 diff --git a/tests/templates/kuttl/cluster-operation/30-pause-trino.yaml.j2 b/tests/templates/kuttl/cluster-operation/30-pause-trino.yaml.j2 index c80ed5a5..4a768c68 100644 --- a/tests/templates/kuttl/cluster-operation/30-pause-trino.yaml.j2 +++ b/tests/templates/kuttl/cluster-operation/30-pause-trino.yaml.j2 @@ -4,33 +4,6 @@ kind: TrinoCluster metadata: name: trino spec: - image: -{% if test_scenario['values']['trino-latest'].find(",") > 0 %} - custom: "{{ test_scenario['values']['trino-latest'].split(',')[1] }}" - productVersion: "{{ test_scenario['values']['trino-latest'].split(',')[0] }}" -{% else %} - productVersion: "{{ test_scenario['values']['trino-latest'] }}" -{% endif %} - pullPolicy: IfNotPresent - clusterConfig: - catalogLabelSelector: {} -{% if lookup('env', 'VECTOR_AGGREGATOR') %} - vectorAggregatorConfigMapName: vector-aggregator-discovery -{% endif %} clusterOperation: stopped: false reconciliationPaused: true - coordinators: - config: - logging: - enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} - roleGroups: - default: - replicas: 1 - workers: - config: - logging: - enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} - roleGroups: - default: - replicas: 1 diff --git a/tests/templates/kuttl/cluster-operation/40-restart-trino.yaml.j2 b/tests/templates/kuttl/cluster-operation/40-restart-trino.yaml.j2 index a6021a91..46bca973 100644 --- a/tests/templates/kuttl/cluster-operation/40-restart-trino.yaml.j2 +++ b/tests/templates/kuttl/cluster-operation/40-restart-trino.yaml.j2 @@ -4,33 +4,6 @@ kind: TrinoCluster metadata: name: trino spec: - image: -{% if test_scenario['values']['trino-latest'].find(",") > 0 %} - custom: "{{ test_scenario['values']['trino-latest'].split(',')[1] }}" - productVersion: "{{ test_scenario['values']['trino-latest'].split(',')[0] }}" -{% else %} - productVersion: "{{ test_scenario['values']['trino-latest'] }}" -{% endif %} - pullPolicy: IfNotPresent - clusterConfig: - catalogLabelSelector: {} -{% if lookup('env', 'VECTOR_AGGREGATOR') %} - vectorAggregatorConfigMapName: vector-aggregator-discovery -{% endif %} clusterOperation: stopped: false reconciliationPaused: false - coordinators: - config: - logging: - enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} - roleGroups: - default: - replicas: 1 - workers: - config: - logging: - enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} - roleGroups: - default: - replicas: 1 diff --git a/tests/templates/kuttl/opa-authorization/12-stop-opa.yaml.j2 b/tests/templates/kuttl/opa-authorization/12-stop-opa.yaml.j2 deleted file mode 100644 index 9e11b388..00000000 --- a/tests/templates/kuttl/opa-authorization/12-stop-opa.yaml.j2 +++ /dev/null @@ -1,21 +0,0 @@ ---- -apiVersion: opa.stackable.tech/v1alpha1 -kind: OpaCluster -metadata: - name: opa -spec: - image: - productVersion: "{{ test_scenario['values']['opa'] }}" - pullPolicy: IfNotPresent - clusterOperation: - reconciliationPaused: true -{% if lookup('env', 'VECTOR_AGGREGATOR') %} - clusterConfig: - vectorAggregatorConfigMapName: vector-aggregator-discovery -{% endif %} - servers: - config: - logging: - enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }} - roleGroups: - default: {} diff --git a/tests/templates/kuttl/opa-authorization/50-assert.yaml b/tests/templates/kuttl/opa-authorization/50-assert.yaml new file mode 100644 index 00000000..cba9e37f --- /dev/null +++ b/tests/templates/kuttl/opa-authorization/50-assert.yaml @@ -0,0 +1,7 @@ +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestAssert +timeout: 300 +commands: + # Check that a graceful shutdown was triggered (it needs OPA permissions) + - script: 'kubectl -n $NAMESPACE logs trino-worker-default-0 | grep -P "io.trino.server.NodeStateManager[\h]*Shutdown requested"' diff --git a/tests/templates/kuttl/opa-authorization/50-restart-trino-worker b/tests/templates/kuttl/opa-authorization/50-restart-trino-worker new file mode 100644 index 00000000..8691ae29 --- /dev/null +++ b/tests/templates/kuttl/opa-authorization/50-restart-trino-worker @@ -0,0 +1,8 @@ +--- +apiVersion: trino.stackable.tech/v1alpha1 +kind: TrinoCluster +metadata: + name: trino +spec: + clusterOperation: + stopped: true