diegoalvarez-clarity commented on code in PR #70180:
URL: https://github.com/apache/airflow/pull/70180#discussion_r4045784694
##########
chart/tests/helm_tests/airflow_aux/test_airflow_common.py:
##########
@@ -416,6 +416,42 @@ def test_have_all_config_mounts_on_init_containers(self):
for doc in docs:
assert expected_mount in
jmespath.search("spec.template.spec.initContainers[0].volumeMounts", doc)
+ def test_mount_config_as_dir(self):
+ components = [
+ "templates/scheduler/scheduler-deployment.yaml",
+ "templates/workers/worker-deployment.yaml",
+ "templates/api-server/api-server-deployment.yaml",
+ "templates/triggerer/triggerer-deployment.yaml",
+ "templates/dag-processor/dag-processor-deployment.yaml",
+ ]
+ docs = render_chart(
+ values={"mountConfigAsDir": True, "airflowLocalSettings": "# local
settings"},
+ show_only=components,
+ )
+ assert len(docs) == len(components)
+ dir_mount = {"name": "config", "mountPath": "/opt/airflow/config",
"readOnly": True}
+ for doc in docs:
+ mounts =
jmespath.search("spec.template.spec.containers[0].volumeMounts", doc)
+ # airflow.cfg / airflow_local_settings.py are now served from the
mounted directory
+ assert dir_mount in mounts
+ assert not [m for m in mounts if m.get("subPath") in
("airflow.cfg", "airflow_local_settings.py")]
+ # AIRFLOW_CONFIG points Airflow at the config in the mounted
directory
+ env = jmespath.search("spec.template.spec.containers[0].env", doc)
+ assert {"name": "AIRFLOW_CONFIG", "value":
"/opt/airflow/config/airflow.cfg"} in env
+
+ def test_config_mounted_via_subpath_by_default(self):
+ docs = render_chart(
+ values={"airflowLocalSettings": "# local settings"},
Review Comment:
Split in 05572dab2e. test_config_mounted_via_subpath_by_default renders with
no values and also asserts no directory mount and no AIRFLOW_CONFIG. The
airflowLocalSettings case moved to
test_local_settings_mounted_via_subpath_when_set.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]