alanatlemba commented on code in PR #27457:
URL: https://github.com/apache/airflow/pull/27457#discussion_r1014039684
##########
tests/providers/cncf/kubernetes/operators/test_kubernetes_pod.py:
##########
@@ -97,6 +97,53 @@ def setup(self, dag_maker):
patch.stopall()
+ def test_template_fields(self):
+ assert 9 == KubernetesPodOperator.template_fields.__len__()
+ KubernetesPodOperator.template_fields.__contains__('image')
+ KubernetesPodOperator.template_fields.__contains__('cmds')
+ KubernetesPodOperator.template_fields.__contains__('arguments')
+ KubernetesPodOperator.template_fields.__contains__('env_vars')
+ KubernetesPodOperator.template_fields.__contains__('labels')
+ KubernetesPodOperator.template_fields.__contains__('config_file')
+ KubernetesPodOperator.template_fields.__contains__('pod_template_file')
+ KubernetesPodOperator.template_fields.__contains__('namespace')
+
KubernetesPodOperator.template_fields.__contains__('container_resources')
+
+ def test_templates(self, create_task_instance_of_operator):
+ dag_id = 'TestKubernetesPodOperator'
+ ti = create_task_instance_of_operator(
+ KubernetesPodOperator,
+ dag_id=dag_id,
+ task_id='task-id',
+ namespace='{{ dag.dag_id }}',
+ container_resources=k8s.V1ResourceRequirements(
+ requests={'memory': 'my_requested_memory', 'cpu':
'my_requested_cpu'},
+ limits={'memory': 'my_memory_limit', 'cpu': 'my_cpu_limit'},
Review Comment:
@eladkal I left those out by accident. I wanted to ensure the
limit/requested didn't get their wires crossed. I'll put back the jinja
templates now to follow suit w/ what everyone else is doing here.
--
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]