-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass image_pull_policy in KubernetesPodOperator correctly #13289
Conversation
image_pull_policy is not being passed into the V1Container in KubernetesPodOperator.
2ccdb90
to
7cc5c63
Compare
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest master or amend the last commit of the PR, and push it with --force-with-lease. |
@mock.patch("airflow.kubernetes.pod_launcher.PodLauncher.start_pod") | ||
@mock.patch("airflow.kubernetes.pod_launcher.PodLauncher.monitor_pod") | ||
@mock.patch("airflow.kubernetes.kube_client.get_kube_client") | ||
def test_image_pull_policy_correctly_set(self, mock_client, monitor_mock, start_mock): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we have one more test case, where we don't explicitly specify image_pull_policy
then assert it against default value IfNotPresent
?
image_pull_policy should be IfNotPresent by default if it's not set. The test ensure the correct value is passed to the V1Container object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @KevYuen !
We can merge this after the CI succeeds. I will take care of it.
Thanks for the contribution!
The PR is likely OK to be merged with just subset of tests for default Python and Database versions without running the full matrix of tests, because it does not modify the core of Airflow. If the committers decide that the full tests matrix is needed, they will add the label 'full tests needed'. Then you should rebase to the latest master or amend the last commit of the PR, and push it with --force-with-lease. |
Thanks @XD-DENG! Much appreciated |
No problem ;-) Happy holidays ahead btw! |
The apache#13289 fixed imagePullPolicy behaviour but broke master K8S tests. This PR attempts to fix it.
The #13289 fixed imagePullPolicy behaviour but broke master K8S tests. This PR attempts to fix it.
* pass image_pull_policy to V1Container image_pull_policy is not being passed into the V1Container in KubernetesPodOperator. This commit fixes this. * add test for image_pull_policy not set image_pull_policy should be IfNotPresent by default if it's not set. The test ensure the correct value is passed to the V1Container object. (cherry picked from commit 7a560ab)
* pass image_pull_policy to V1Container image_pull_policy is not being passed into the V1Container in KubernetesPodOperator. This commit fixes this. * add test for image_pull_policy not set image_pull_policy should be IfNotPresent by default if it's not set. The test ensure the correct value is passed to the V1Container object. (cherry picked from commit 7a560ab)
The apache#13289 fixed imagePullPolicy behaviour but broke master K8S tests. This PR attempts to fix it. (cherry picked from commit 6f246b0) (cherry picked from commit fd0fddc)
image_pull_policy is not being passed into the V1Container in
KubernetesPodOperator
This causes pods to not re-pull images even if the value is set.