galuszkak commented on a change in pull request #4952: 
feat/AIRFLOW-4008/k8s-executor-env-from
URL: https://github.com/apache/airflow/pull/4952#discussion_r267729630
 
 

 ##########
 File path: 
airflow/contrib/kubernetes/kubernetes_request_factory/kubernetes_request_factory.py
 ##########
 @@ -196,3 +196,18 @@ def extract_tolerations(pod, req):
     def extract_security_context(pod, req):
         if pod.security_context:
             req['spec']['securityContext'] = pod.security_context
+
+    @staticmethod
+    def extract_env_from(pod, req):
+        if pod.env_from_configmap_ref or pod.env_from_secret_ref:
+            configmap_refs = [{
+                'configMapRef': {
+                    'name': configmap_ref
+                }
+            } for configmap_ref in pod.env_from_configmap_ref.split(',')]
+            secret_refs = [{
+                'secretRef': {
+                    'name': secret_ref
+                }
+            } for secret_ref in pod.env_from_secret_ref.split(',')]
+            req['spec']['containers'][0]['envFrom'] = configmap_refs + 
secret_refs
 
 Review comment:
   As suggested by @ashb in my PR (#4772) this should be removed from seperate 
method and moved to `extract_env_and_secrets`. I had done this the same You did 
that, but it was rejected in my code review in #4772.

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


With regards,
Apache Git Services

Reply via email to