bcanvural commented on code in PR #74587:
URL: https://github.com/apache/airflow/pull/74587#discussion_r4577491997
##########
chart/tests/helm_tests/airflow_core/test_worker.py:
##########
@@ -1924,6 +1925,26 @@ def test_ip_family_policy_not_set_by_default(self):
assert jmespath.search("spec.ipFamilyPolicy", docs[0]) is None
assert jmespath.search("spec.ipFamilies", docs[0]) is None
+ def test_selector_excludes_kubernetes_executor_pods(self):
+ docs = render_chart(
+ values={"executor": "KubernetesExecutor,CeleryExecutor"},
+ show_only=[
+ "templates/configmaps/configmap.yaml",
+ "templates/workers/worker-deployment.yaml",
+ "templates/workers/worker-service.yaml",
+ ],
+ )
+
+ configmap, worker, service = docs
+ selector = service["spec"]["selector"].items()
+ celery_pod_labels =
worker["spec"]["template"]["metadata"]["labels"].items()
+ kubernetes_pod_labels =
yaml.safe_load(configmap["data"]["pod_template_file.yaml"])["metadata"][
+ "labels"
+ ].items()
Review Comment:
Done — switched the test to `jmespath.search` for the selector, the Celery
pod labels and the pod template labels. The pod template is still parsed with
`yaml.safe_load`, since it's stored as a YAML string inside the configmap.
--
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]