Pass image_pull_policy in KubernetesPodOperator correctly#13289
Pass image_pull_policy in KubernetesPodOperator correctly#13289XD-DENG merged 3 commits intoapache:masterfrom
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.
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.
|
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
KubernetesPodOperatorThis causes pods to not re-pull images even if the value is set.