Skip to content

Commit 7fc4412

Browse files
Apply suggestions from code review
Co-authored-by: Nick <10092581+NickLarsenNZ@users.noreply.github.com>
1 parent 3ba3a62 commit 7fc4412

2 files changed

Lines changed: 11 additions & 13 deletions

File tree

demos/airflow-scheduled-job/04-enable-and-run-date-dag.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ spec:
1313
# restarted. Additionally, the db-init job takes a few minutes to complete before the cluster is deployed. The wait/watch steps
1414
# below are not "water-tight" but add a layer of stability by at least ensuring that the db is initialized and ready and that
1515
# all pods are reachable (albeit independent of each other).
16-
command: [
17-
"bash",
18-
"-c",
19-
'
16+
command:
17+
- bash
18+
- -euo
19+
- pipefail
20+
- -c
21+
- |
2022
kubectl rollout status --watch statefulset/airflow-webserver-default
21-
&& kubectl rollout status --watch statefulset/airflow-scheduler-default
22-
&& export AIRFLOW_ADMIN_PASSWORD=$(cat /airflow-credentials/adminUser.password)
23-
&& export ACCESS_TOKEN=$(curl -XPOST http://airflow-webserver-default-headless:8080/auth/token -H ''Content-Type: application/json'' -d ''{"username": "admin", "password": "''$AIRFLOW_ADMIN_PASSWORD''"}'' | jq ''.access_token'' | tr -d ''"'')
24-
&& curl -H "Authorization: Bearer $ACCESS_TOKEN" -H ''Content-Type: application/json'' -XPATCH http://airflow-webserver-default-headless:8080/api/v2/dags/date_demo -d ''{"is_paused": false}'' | jq
25-
&& curl -H "Authorization: Bearer $ACCESS_TOKEN" -H ''Content-Type: application/json'' -XPOST http://airflow-webserver-default-headless:8080/api/v2/dags/date_demo/dagRuns -d ''{"logical_date": null}'' | jq
26-
',
27-
]
23+
kubectl rollout status --watch statefulset/airflow-scheduler-default
24+
AIRFLOW_ADMIN_PASSWORD=$(cat /airflow-credentials/adminUser.password)
25+
ACCESS_TOKEN=$(curl -XPOST http://airflow-webserver-default-headless:8080/auth/token -H 'Content-Type: application/json' -d '{"username": "admin", "password": "'$AIRFLOW_ADMIN_PASSWORD'"}' | jq -r .access_token)
26+
curl -H "Authorization: Bearer $ACCESS_TOKEN" -H 'Content-Type: application/json' -XPATCH http://airflow-webserver-default-headless:8080/api/v2/dags/date_demo -d '{"is_paused": false}' | jq
27+
curl -H "Authorization: Bearer $ACCESS_TOKEN" -H 'Content-Type: application/json' -XPOST http://airflow-webserver-default-headless:8080/api/v2/dags/date_demo/dagRuns -d '{"logical_date": null}' | jq
2828
volumeMounts:
2929
- name: airflow-credentials
3030
mountPath: /airflow-credentials

stacks/airflow/airflow.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,6 @@ data:
303303
memory:
304304
limit: 1024Mi
305305
replicas: 3
306-
307-
308306
# {% endraw %}
309307
---
310308
apiVersion: v1

0 commit comments

Comments
 (0)