From f6a4f84487f604be73a554989776ac2e9e18d357 Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Thu, 27 Jun 2024 09:49:03 +0200 Subject: [PATCH] Use a ConfigMap for the prepared logs in the logging test --- .../40-create-configmap-with-prepared-logs.yaml | 8 ++++++++ .../kuttl/logging/{40-assert.yaml => 41-assert.yaml} | 0 .../kuttl/logging/41-copy-prepared-logs.yaml | 8 -------- ...ter.yaml.j2 => 41-install-airflow-cluster.yaml.j2} | 11 +++++++++++ 4 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 tests/templates/kuttl/logging/40-create-configmap-with-prepared-logs.yaml rename tests/templates/kuttl/logging/{40-assert.yaml => 41-assert.yaml} (100%) delete mode 100644 tests/templates/kuttl/logging/41-copy-prepared-logs.yaml rename tests/templates/kuttl/logging/{40-install-airflow-cluster.yaml.j2 => 41-install-airflow-cluster.yaml.j2} (92%) diff --git a/tests/templates/kuttl/logging/40-create-configmap-with-prepared-logs.yaml b/tests/templates/kuttl/logging/40-create-configmap-with-prepared-logs.yaml new file mode 100644 index 00000000..3d59fbc0 --- /dev/null +++ b/tests/templates/kuttl/logging/40-create-configmap-with-prepared-logs.yaml @@ -0,0 +1,8 @@ +--- +apiVersion: kuttl.dev/v1beta1 +kind: TestStep +commands: + - script: > + kubectl create configmap prepared-logs + --from-file=prepared-logs.py.json + --namespace=$NAMESPACE diff --git a/tests/templates/kuttl/logging/40-assert.yaml b/tests/templates/kuttl/logging/41-assert.yaml similarity index 100% rename from tests/templates/kuttl/logging/40-assert.yaml rename to tests/templates/kuttl/logging/41-assert.yaml diff --git a/tests/templates/kuttl/logging/41-copy-prepared-logs.yaml b/tests/templates/kuttl/logging/41-copy-prepared-logs.yaml deleted file mode 100644 index 1ca6b43f..00000000 --- a/tests/templates/kuttl/logging/41-copy-prepared-logs.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -apiVersion: kuttl.dev/v1beta1 -kind: TestStep -commands: - - script: > - kubectl cp ./prepared-logs.py.json - $NAMESPACE/airflow-webserver-automatic-log-config-0:/stackable/log/airflow/prepared-logs.py.json - --container vector diff --git a/tests/templates/kuttl/logging/40-install-airflow-cluster.yaml.j2 b/tests/templates/kuttl/logging/41-install-airflow-cluster.yaml.j2 similarity index 92% rename from tests/templates/kuttl/logging/40-install-airflow-cluster.yaml.j2 rename to tests/templates/kuttl/logging/41-install-airflow-cluster.yaml.j2 index f36d18a4..78eef604 100644 --- a/tests/templates/kuttl/logging/40-install-airflow-cluster.yaml.j2 +++ b/tests/templates/kuttl/logging/41-install-airflow-cluster.yaml.j2 @@ -86,6 +86,17 @@ spec: loggers: ROOT: level: INFO + podOverrides: + spec: + containers: + - name: vector + volumeMounts: + - name: prepared-logs + mountPath: /stackable/log/prepared-logs + volumes: + - name: prepared-logs + configMap: + name: prepared-logs custom-log-config: replicas: 1 config: