-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pass volumes/volume-mounts and env-vars through to gitsync containers (…
…#456) * pass volumes/volume-monuts and env-vars through to gitsync containers * changelog * adapted gitsync test for envs and mounts * pass pod overrides to template * Update tests/templates/kuttl/mount-dags-gitsync/31-assert.yaml.j2 Co-authored-by: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> * refactored duplicate code --------- Co-authored-by: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com>
- Loading branch information
Showing
5 changed files
with
85 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
tests/templates/kuttl/mount-dags-gitsync/31-assert.yaml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
apiVersion: kuttl.dev/v1beta1 | ||
kind: TestAssert | ||
timeout: 30 | ||
commands: | ||
|
||
{% if test_scenario['values']['executor'] == 'kubernetes' %} | ||
# check that the executor template configmap contains mounts and envs | ||
# will expect 4 (2 from from the volume declaration + mounts to two containers, base and gitsync) | ||
- script: kubectl -n $NAMESPACE get cm airflow-executor-pod-template -o json | jq -r '.data."airflow_executor_pod_template.yaml"' | grep "test-cm-gitsync" | wc -l | grep 4 | ||
# will expect 2 (two containers, base and gitsync) | ||
- script: kubectl -n $NAMESPACE get cm airflow-executor-pod-template -o json | jq -r '.data."airflow_executor_pod_template.yaml"' | grep "AIRFLOW_TEST_VAR" | wc -l | grep 2 | ||
{% else %} | ||
# check that the statefulset contains mounts and envs | ||
# will expect 6 (2 from from the volume declaration + mounts to 3 containers, base and 2 gitsyncs, plus configmap restarter) | ||
- script: kubectl -n $NAMESPACE get sts airflow-worker-default -o json | grep "test-cm-gitsync" | wc -l | grep 6 | ||
# will expect 3 (two containers, base and gitsync-1, and one initContainer gitsync-0) | ||
- script: kubectl -n $NAMESPACE get sts airflow-worker-default -o json | grep "AIRFLOW_TEST_VAR" | wc -l | grep 3 | ||
{% endif %} |