Skip to content

Commit

Permalink
Fix kuttl tests (#482)
Browse files Browse the repository at this point in the history
* add password-update-container after trino container

* fix tls tests

* set gracefultime out period to fix orphaned resources test

* set gracefulShutdownTimeout to fix cluster operations test

* set gracefulShutdownTimeout in every test to avoid insufficient cluster resources due to terminating pods.
  • Loading branch information
maltesander authored Oct 5, 2023
1 parent b3512af commit b3b2006
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 4 deletions.
3 changes: 3 additions & 0 deletions rust/operator-binary/src/authentication/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,10 @@ impl TrinoAuthenticationConfig {
stackable_trino_crd::Container::Vector => {}
}
}
}

/// Add required init / side car containers
pub fn add_authentication_containers(&self, role: &TrinoRole, pod_builder: &mut PodBuilder) {
// containers
for container in self.sidecar_containers(role) {
pod_builder.add_container(container);
Expand Down
3 changes: 3 additions & 0 deletions rust/operator-binary/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,9 @@ fn build_rolegroup_statefulset(
// add trino container first to better default into that container (e.g. instead of vector)
pod_builder.add_container(container_trino);

// add password-update container if required
trino_authentication_config.add_authentication_containers(trino_role, &mut pod_builder);

if let Some(ContainerLogConfig {
choice:
Some(ContainerLogConfigChoice::Custom(CustomContainerLogConfig {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ spec:
productVersion: "'"{{ test_scenario['values']['trino-latest'] }}"'"
clusterConfig:
catalogLabelSelector: {}
gracefulShutdownTimeout: 5s
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
vectorAggregatorConfigMapName: vector-aggregator-discovery
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ spec:
productVersion: "{{ test_scenario['values']['trino-latest'] }}"
clusterConfig:
catalogLabelSelector: {}
gracefulShutdownTimeout: 5s
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
vectorAggregatorConfigMapName: vector-aggregator-discovery
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ spec:
productVersion: "{{ test_scenario['values']['trino-latest'] }}"
clusterConfig:
catalogLabelSelector: {}
gracefulShutdownTimeout: 5s
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
vectorAggregatorConfigMapName: vector-aggregator-discovery
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ spec:
productVersion: "{{ test_scenario['values']['trino-latest'] }}"
clusterConfig:
catalogLabelSelector: {}
gracefulShutdownTimeout: 5s
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
vectorAggregatorConfigMapName: vector-aggregator-discovery
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ spec:
productVersion: "{{ test_scenario['values']['trino-latest'] }}"
clusterConfig:
catalogLabelSelector: {}
gracefulShutdownTimeout: 5s
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
vectorAggregatorConfigMapName: vector-aggregator-discovery
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions tests/templates/kuttl/logging/02-install-trino.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ spec:
productVersion: "{{ test_scenario['values']['trino'] }}"
clusterConfig:
catalogLabelSelector: {}
gracefulShutdownTimeout: 5s
vectorAggregatorConfigMapName: trino-vector-aggregator-discovery
# in order to add the password-file-updater container
authentication:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ spec:
productVersion: "{{ test_scenario['values']['trino-latest'] }}"
clusterConfig:
catalogLabelSelector: {}
gracefulShutdownTimeout: 5s
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
vectorAggregatorConfigMapName: vector-aggregator-discovery
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions tests/templates/kuttl/resources/10-install-trino.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ spec:
productVersion: "{{ test_scenario['values']['trino-latest'] }}"
clusterConfig:
catalogLabelSelector: {}
gracefulShutdownTimeout: 5s
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
vectorAggregatorConfigMapName: vector-aggregator-discovery
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions tests/templates/kuttl/smoke/10-install-trino.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ spec:
opa:
configMapName: opa
package: trino
gracefulShutdownTimeout: 5s
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
vectorAggregatorConfigMapName: vector-aggregator-discovery
{% endif %}
Expand Down
1 change: 1 addition & 0 deletions tests/templates/kuttl/tls/10-install-trino.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ spec:
productVersion: "{{ test_scenario['values']['trino-latest'] }}"
clusterConfig:
catalogLabelSelector: {}
gracefulShutdownTimeout: 5s
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
vectorAggregatorConfigMapName: vector-aggregator-discovery
{% endif %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ spec:
labels:
app: trino-test-helper
spec:
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
containers:
- name: trino-test-helper
image: docker.stackable.tech/stackable/testing-tools:0.2.0-stackable0.0.0-dev
command: ["sleep", "infinity"]
{% if test_scenario['values']['use-tls'] == 'true' %}
volumeMounts:
- mountPath: "/stackable/trusted"
name: server-tls-mount
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 1000
volumes:
- name: server-tls-mount
ephemeral:
Expand All @@ -40,3 +41,4 @@ spec:
requests:
storage: "1"
storageClassName: secrets.stackable.tech
{% endif %}

0 comments on commit b3b2006

Please sign in to comment.