You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/03/01 07:52:43 UTC
[GitHub] feng-tao commented on a change in pull request #4772: [AIRFLOW-3937] KubernetesPodOperator support for envFrom configMapRef…
feng-tao commented on a change in pull request #4772: [AIRFLOW-3937] KubernetesPodOperator support for envFrom configMapRef…
URL: https://github.com/apache/airflow/pull/4772#discussion_r261506193
##########
File path: airflow/contrib/kubernetes/kubernetes_request_factory/kubernetes_request_factory.py
##########
@@ -191,3 +191,10 @@ def extract_image_pull_secrets(pod, req):
def extract_tolerations(pod, req):
if pod.tolerations:
req['spec']['tolerations'] = pod.tolerations
+
+ @staticmethod
+ def extract_env_from(pod, req):
+ for idx, configmap in enumerate(pod.envs_from_configmaps):
+ req['spec']['containers'][0]['envFrom'][idx]['configMapRef']['name'] = configmap.name
Review comment:
I am not very familiar with Airflow k8s code. But this seems to a long chain of map? Does it always work? Could it happen when the key doesn't exist in the dict which causes exception?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services