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 2021/05/12 02:11:21 UTC

[GitHub] [airflow] jpyen opened a new pull request #15787: Bug Fix Pod-Template Affinity Ignored due to empty Affinity K8S Object

jpyen opened a new pull request #15787:
URL: https://github.com/apache/airflow/pull/15787


   **Issue**:
   KubernetesPodOperator pod-template files with pod affinities are ignored, even if no affinities are passed to the KubernetesPodOperator object. 
   
   **Cause** 
   During the pod-initialization an empty k8s.Affinity object is created if no affinities are supplied. This will later prevent the pod-template affinities to be used, because during the pod_reconciliation the empty k8s.Affinity object takes precedence. 
   All other attributes such as
   `        self.k8s_resources = convert_resources(resources) if resources else {}
           self.image_pull_secrets = convert_image_pull_secrets(image_pull_secrets) if image_pull_secrets else []
   `
   handle it properly.


-- 
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] jedcunningham commented on pull request #15787: Bug Fix Pod-Template Affinity Ignored due to empty Affinity K8S Object

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on pull request #15787:
URL: https://github.com/apache/airflow/pull/15787#issuecomment-844140950


   @jpyen, looks good, thanks.
   
   The static checks failed, however. If you haven't already, [installing pre-commit hooks](https://github.com/apache/airflow/blob/master/STATIC_CODE_CHECKS.rst#prerequisites-for-pre-commit-hooks) can make that easier. Or you can format manually with black.


-- 
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] jpyen commented on pull request #15787: Bug Fix Pod-Template Affinity Ignored due to empty Affinity K8S Object

Posted by GitBox <gi...@apache.org>.
jpyen commented on pull request #15787:
URL: https://github.com/apache/airflow/pull/15787#issuecomment-843769787


   @jedcunningham added test coverage, does that work for you?


-- 
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 #15787: Bug Fix Pod-Template Affinity Ignored due to empty Affinity K8S Object

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


   [The Workflow run](https://github.com/apache/airflow/actions/runs/857832451) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


-- 
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] jedcunningham commented on pull request #15787: Bug Fix Pod-Template Affinity Ignored due to empty Affinity K8S Object

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on pull request #15787:
URL: https://github.com/apache/airflow/pull/15787#issuecomment-841743208


   @jpyen, can you add test coverage? You can probably just add it to this test: https://github.com/apache/airflow/blob/3919ee6eb9042562b6cafae7c34e476fbb413e13/tests/providers/cncf/kubernetes/operators/test_kubernetes_pod.py#L327


-- 
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 pull request #15787: Bug Fix Pod-Template Affinity Ignored due to empty Affinity K8S Object

Posted by GitBox <gi...@apache.org>.
kaxil commented on pull request #15787:
URL: https://github.com/apache/airflow/pull/15787#issuecomment-845177985


   Thanks @jpyen and @jedcunningham 


-- 
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 merged pull request #15787: Bug Fix Pod-Template Affinity Ignored due to empty Affinity K8S Object

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


   


-- 
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 #15787: Bug Fix Pod-Template Affinity Ignored due to empty Affinity K8S Object

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


   [The Workflow run](https://github.com/apache/airflow/actions/runs/833911599) is cancelling this PR. It has some failed jobs matching ^Pylint$,^Static checks,^Build docs$,^Spell check docs$,^Provider packages,^Checks: Helm tests$,^Test OpenAPI*.


-- 
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] jedcunningham commented on pull request #15787: Bug Fix Pod-Template Affinity Ignored due to empty Affinity K8S Object

Posted by GitBox <gi...@apache.org>.
jedcunningham commented on pull request #15787:
URL: https://github.com/apache/airflow/pull/15787#issuecomment-841743208


   @jpyen, can you add test coverage? You can probably just add it to this test: https://github.com/apache/airflow/blob/3919ee6eb9042562b6cafae7c34e476fbb413e13/tests/providers/cncf/kubernetes/operators/test_kubernetes_pod.py#L327


-- 
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] jpyen commented on pull request #15787: Bug Fix Pod-Template Affinity Ignored due to empty Affinity K8S Object

Posted by GitBox <gi...@apache.org>.
jpyen commented on pull request #15787:
URL: https://github.com/apache/airflow/pull/15787#issuecomment-844602385


   @jedcunningham all checks passed


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