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 2020/11/18 15:32:33 UTC

[GitHub] [airflow] dimberman opened a new pull request #12451: Fix backwards compatibility further

dimberman opened a new pull request #12451:
URL: https://github.com/apache/airflow/pull/12451


   This PR ensures that node_selector, affinity, and tolerations are all
   converted into k8s API objects before they are sent to the
   pod_mutation_hook. this fixes an inconsistency that would force airflow
   engineers to consider both cases when writing their pod_mutation_hook
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/master/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/master/UPDATING.md).
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on a change in pull request #12451: Fix backwards compatibility further

Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #12451:
URL: https://github.com/apache/airflow/pull/12451#discussion_r526184258



##########
File path: airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py
##########
@@ -129,3 +139,33 @@ def convert_configmap(configmaps) -> k8s.V1EnvFromSource:
     :return:
     """
     return k8s.V1EnvFromSource(config_map_ref=k8s.V1ConfigMapEnvSource(name=configmaps))
+
+
+def convert_affinity(affinity) -> k8s.V1Affinity:
+    """
+    Converts a dict into an k8s.V1Affinity
+
+    :param affinity:

Review comment:
       Let's remove the empty string param or add descriptions

##########
File path: airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py
##########
@@ -129,3 +139,33 @@ def convert_configmap(configmaps) -> k8s.V1EnvFromSource:
     :return:
     """
     return k8s.V1EnvFromSource(config_map_ref=k8s.V1ConfigMapEnvSource(name=configmaps))
+
+
+def convert_affinity(affinity) -> k8s.V1Affinity:
+    """
+    Converts a dict into an k8s.V1Affinity
+
+    :param affinity:
+    :return:
+    """
+    return _convert_from_dict(affinity, k8s.V1Affinity)
+
+
+def convert_node_selector(node_selector) -> k8s.V1NodeSelector:
+    """
+    Converts a dict into an k8s.V1NodeSelector
+
+    :param node_selector:
+    :return:
+    """
+    return _convert_from_dict(node_selector, k8s.V1NodeSelector)
+
+
+def convert_toleration(toleration) -> k8s.V1Toleration:
+    """
+    Converts a dict into an k8s.V1Toleration
+
+    :param toleration:

Review comment:
       same here




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #12451: Fix backwards compatibility further

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #12451:
URL: https://github.com/apache/airflow/pull/12451#issuecomment-729760423


   The PR should be OK to be merged with just subset of tests as it does not modify Core of Airflow. The committers might merge it or can add a label 'full tests needed' and re-run it to run all tests if they see it is needed!


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] kaxil commented on a change in pull request #12451: Fix backwards compatibility further

Posted by GitBox <gi...@apache.org>.
kaxil commented on a change in pull request #12451:
URL: https://github.com/apache/airflow/pull/12451#discussion_r526183868



##########
File path: airflow/providers/cncf/kubernetes/backcompat/backwards_compat_converters.py
##########
@@ -129,3 +139,33 @@ def convert_configmap(configmaps) -> k8s.V1EnvFromSource:
     :return:
     """
     return k8s.V1EnvFromSource(config_map_ref=k8s.V1ConfigMapEnvSource(name=configmaps))
+
+
+def convert_affinity(affinity) -> k8s.V1Affinity:
+    """
+    Converts a dict into an k8s.V1Affinity
+
+    :param affinity:
+    :return:
+    """
+    return _convert_from_dict(affinity, k8s.V1Affinity)
+
+
+def convert_node_selector(node_selector) -> k8s.V1NodeSelector:
+    """
+    Converts a dict into an k8s.V1NodeSelector
+
+    :param node_selector:

Review comment:
       This is empty




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] dimberman merged pull request #12451: Fix backwards compatibility further

Posted by GitBox <gi...@apache.org>.
dimberman merged pull request #12451:
URL: https://github.com/apache/airflow/pull/12451


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [airflow] github-actions[bot] commented on pull request #12451: Fix backwards compatibility further

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #12451:
URL: https://github.com/apache/airflow/pull/12451#issuecomment-729764840


   The PR should be OK to be merged with just subset of tests as it does not modify Core of Airflow. The committers might merge it or can add a label 'full tests needed' and re-run it to run all tests if they see it is needed!


----------------------------------------------------------------
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:
users@infra.apache.org