From 55fdb14ca97c68f8146ed40dcb96b0c9ed2e077c Mon Sep 17 00:00:00 2001 From: Erik Vattekar Date: Fri, 14 Jun 2024 10:55:35 +0200 Subject: [PATCH] specify k8s namespace for k8s pod operator --- dataverk_airflow/kubernetes_operator.py | 1 + tests-integration/dbt/k8s_resources/oracle-db.yaml | 2 ++ tests-integration/knada.py | 3 +++ 3 files changed, 6 insertions(+) diff --git a/dataverk_airflow/kubernetes_operator.py b/dataverk_airflow/kubernetes_operator.py index 13a2945..34d7cac 100644 --- a/dataverk_airflow/kubernetes_operator.py +++ b/dataverk_airflow/kubernetes_operator.py @@ -166,6 +166,7 @@ def on_failure(context): on_finish_action=on_finish_action, annotations={"allowlist": ",".join(allowlist)}, image=image, + namespace=namespace, env_vars=env_vars(is_composer, extra_envs), env_from=[env_from_secret(secret) for secret in env_from_secrets], config_file=config_file(is_composer), diff --git a/tests-integration/dbt/k8s_resources/oracle-db.yaml b/tests-integration/dbt/k8s_resources/oracle-db.yaml index b0b66b3..8c7fe2b 100644 --- a/tests-integration/dbt/k8s_resources/oracle-db.yaml +++ b/tests-integration/dbt/k8s_resources/oracle-db.yaml @@ -15,6 +15,8 @@ spec: value: usah - name: APP_USER_PASSWORD value: pass + - name: ORACLE_RANDOM_PASSWORD + value: "true" --- apiVersion: v1 kind: Service diff --git a/tests-integration/knada.py b/tests-integration/knada.py index 5607c6f..19c3c45 100644 --- a/tests-integration/knada.py +++ b/tests-integration/knada.py @@ -112,10 +112,13 @@ dag=dag, name="dbt-build", repo="navikt/dataverk-airflow", + branch="dbt-operator", dbt_cmd="dbt build --profiles-dir tests-integration/dbt --project-dir tests-integration/dbt/nada_dbt_test", image="ghcr.io/navikt/knada/dataverk-airflow-test:v1", retries=0, env_from_secrets=["dbt-secret"], + startup_timeout_seconds=60, + delete_on_finish=False, ) # py_op