nevcohen commented on code in PR #46374:
URL: https://github.com/apache/airflow/pull/46374#discussion_r1945100756


##########
providers/tests/cncf/kubernetes/test_template_rendering.py:
##########
@@ -84,11 +85,34 @@ def test_render_k8s_pod_yaml(pod_mutation_hook, 
create_task_instance):
             ]
         },
     }
-
     assert render_k8s_pod_yaml(ti) == expected_pod_spec
     pod_mutation_hook.assert_called_once_with(mock.ANY)
 
 
[email protected](os.environ, {"AIRFLOW_IS_K8S_EXECUTOR_POD": "True"})
[email protected]("airflow.settings.pod_mutation_hook")
+def test_render_k8s_pod_yaml_with_custom_pod_template(pod_mutation_hook, 
create_task_instance, tmp_path):
+    with open(f"{tmp_path}/custom_pod_template.yaml", "w") as ptf:
+        template = {
+            "apiVersion": "v1",
+            "kind": "Pod",
+            "metadata": {"labels": {"custom_label": "custom_value"}},
+        }
+        ptf.write(yaml.dump(template))
+
+    ti = create_task_instance(
+        dag_id="test_render_k8s_pod_yaml",
+        run_id="test_run_id",
+        task_id="op1",
+        logical_date=DEFAULT_DATE,
+        executor_config={"pod_template_file": 
f"{tmp_path}/custom_pod_template.yaml"},

Review Comment:
   What about a test that combines both override this file and also adding 
`pod_override`? If you think it is necessary



-- 
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]

Reply via email to