You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by di...@apache.org on 2020/08/09 18:59:39 UTC

[airflow] branch v1-10-test updated: add documentation for k8s fixes

This is an automated email from the ASF dual-hosted git repository.

dimberman pushed a commit to branch v1-10-test
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/v1-10-test by this push:
     new 90fe915  add documentation for k8s fixes
90fe915 is described below

commit 90fe91551bbd8d2db527addeee699aa88331691f
Author: Daniel Imberman <da...@gmail.com>
AuthorDate: Sun Aug 9 11:58:37 2020 -0700

    add documentation for k8s fixes
---
 airflow/contrib/kubernetes/pod.py  | 3 +++
 airflow/kubernetes/pod_launcher.py | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/airflow/contrib/kubernetes/pod.py b/airflow/contrib/kubernetes/pod.py
index 5ed563e..944cd8c 100644
--- a/airflow/contrib/kubernetes/pod.py
+++ b/airflow/contrib/kubernetes/pod.py
@@ -198,6 +198,9 @@ class Pod(object):
 
 
 def _extract_env_vars_and_secrets(env_vars):
+    """
+    Extracts environment variables and Secret objects from V1Pod Environment
+    """
     result = {}
     env_vars = env_vars or []  # type: List[Union[k8s.V1EnvVar, dict]]
     secrets = []
diff --git a/airflow/kubernetes/pod_launcher.py b/airflow/kubernetes/pod_launcher.py
index 620df31..875a24c 100644
--- a/airflow/kubernetes/pod_launcher.py
+++ b/airflow/kubernetes/pod_launcher.py
@@ -294,6 +294,10 @@ class PodLauncher(LoggingMixin):
 
 
 def _convert_to_airflow_pod(pod):
+    """
+    Converts a k8s V1Pod object into an `airflow.kubernetes.pod.Pod` object.
+    This function is purely for backwards compatibility
+    """
     base_container = pod.spec.containers[0]  # type: k8s.V1Container
     env_vars, secrets = _extract_env_vars_and_secrets(base_container.env)
     volumes, vol_secrets = _extract_volumes_and_secrets(pod.spec.volumes, base_container.volume_mounts)