kaxil commented on a change in pull request #14083:
URL: https://github.com/apache/airflow/pull/14083#discussion_r570470770



##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -271,6 +273,22 @@ def __init__(  # pylint: 
disable=too-many-arguments,too-many-locals
         self.client: CoreV1Api = None
         self.pod: k8s.V1Pod = None
 
+    def add_template_fields_to_env_vars(self, env_vars):
+        """
+        Adds the field `templated_fields` to V1EnvVar so that Airflow can 
apply jinja templating
+        to both the name and value of an environment variable.
+
+        Addresses https://github.com/apache/airflow/issues/13348
+        @param env_vars:
+        @return:

Review comment:
       ```suggestion
           @param env_vars:
           @return:
   ```
   
   needs description

##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -271,6 +273,22 @@ def __init__(  # pylint: 
disable=too-many-arguments,too-many-locals
         self.client: CoreV1Api = None
         self.pod: k8s.V1Pod = None
 
+    def add_template_fields_to_env_vars(self, env_vars):
+        """
+        Adds the field `templated_fields` to V1EnvVar so that Airflow can 
apply jinja templating
+        to both the name and value of an environment variable.
+
+        Addresses https://github.com/apache/airflow/issues/13348

Review comment:
       ```suggestion
   
   ```

##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -271,6 +273,22 @@ def __init__(  # pylint: 
disable=too-many-arguments,too-many-locals
         self.client: CoreV1Api = None
         self.pod: k8s.V1Pod = None
 
+    def add_template_fields_to_env_vars(self, env_vars):

Review comment:
       Also this only address Env Variables, what about other template_field

##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -271,6 +273,22 @@ def __init__(  # pylint: 
disable=too-many-arguments,too-many-locals
         self.client: CoreV1Api = None
         self.pod: k8s.V1Pod = None
 
+    def add_template_fields_to_env_vars(self, env_vars):

Review comment:
       
https://github.com/apache/airflow/blob/3909232fafd09ac72b49010ecdfd6ea48f06d5cf/airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py#L158-L166

##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -271,6 +273,22 @@ def __init__(  # pylint: 
disable=too-many-arguments,too-many-locals
         self.client: CoreV1Api = None
         self.pod: k8s.V1Pod = None
 
+    def add_template_fields_to_env_vars(self, env_vars):

Review comment:
       We should have something generic that applies to all of this in KPO

##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -271,6 +273,22 @@ def __init__(  # pylint: 
disable=too-many-arguments,too-many-locals
         self.client: CoreV1Api = None
         self.pod: k8s.V1Pod = None
 
+    def add_template_fields_to_env_vars(self, env_vars):

Review comment:
       right that's correct

##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -271,6 +273,22 @@ def __init__(  # pylint: 
disable=too-many-arguments,too-many-locals
         self.client: CoreV1Api = None
         self.pod: k8s.V1Pod = None
 
+    def add_template_fields_to_env_vars(self, env_vars):
+        """
+        Adds the field `templated_fields` to V1EnvVar so that Airflow can 
apply jinja templating
+        to both the name and value of an environment variable.
+
+        Addresses https://github.com/apache/airflow/issues/13348
+        @param env_vars:
+        @return:

Review comment:
       This needs fixing

##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -271,6 +273,21 @@ def __init__(  # pylint: 
disable=too-many-arguments,too-many-locals
         self.client: CoreV1Api = None
         self.pod: k8s.V1Pod = None
 
+    def add_template_fields_to_env_vars(self, env_vars):
+        """
+        Adds the field `templated_fields` to V1EnvVar so that Airflow can 
apply jinja templating

Review comment:
       ```suggestion
           Adds the field ``templated_fields`` to ``V1EnvVar`` so that Airflow 
can apply jinja templating
   ```




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to