akakakakakaa commented on PR #23531:
URL: https://github.com/apache/airflow/pull/23531#issuecomment-1134181785
In addition to previously mentioned by @lior1990,
```
class CustomKubernetesPodOperator(KubernetesPodOperator):
template_fields: Sequence[str] = KubernetesPodOperator.template_fields +
('k8s_resources', )
def _render_nested_template_fields(
self,
content: Any,
context: 'Context',
jinja_env: "jinja2.Environment",
seen_oids: set,
) -> None:
if id(content) not in seen_oids and isinstance(content,
k8s.V1ResourceRequirements):
seen_oids.add(id(content))
self._do_render_template_fields(content, ("limits", "requests"),
context, jinja_env, seen_oids)
return
super()._render_nested_template_fields(content, context, jinja_env,
seen_oids)
```
In KubernetesPodOperator, resources allocated to k8s_resources
```
self.k8s_resources = convert_resources(resources) if resources else {}
````
Instead of resource, k8s_resource should be added to template_fields.
--
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]