Fix KubernetesPodOperator dry_run requiring live Kubernetes API client#70234
Open
Aaryan123456679 wants to merge 1 commit into
Open
Fix KubernetesPodOperator dry_run requiring live Kubernetes API client#70234Aaryan123456679 wants to merge 1 commit into
Aaryan123456679 wants to merge 1 commit into
Conversation
Aaryan123456679
requested review from
hussein-awala,
jedcunningham and
jscheffl
as code owners
July 22, 2026 12:19
Aaryan123456679
force-pushed
the
fix/kpo-dry-run-kube-client-45812
branch
from
July 22, 2026 18:53
7f3ce00 to
b9eba59
Compare
Aaryan123456679
requested review from
amoghrajesh,
ashb,
bugraoz93,
gopidesupavan,
jason810496 and
potiuk
as code owners
July 22, 2026 18:53
Aaryan123456679
force-pushed
the
fix/kpo-dry-run-kube-client-45812
branch
from
July 22, 2026 19:46
b9eba59 to
e540c09
Compare
Contributor
|
There are couple of unrelated changes in the PR + conflics - could you resolve it? |
Aaryan123456679
force-pushed
the
fix/kpo-dry-run-kube-client-45812
branch
from
July 24, 2026 16:08
e540c09 to
e91dc6e
Compare
Contributor
Author
|
Thanks for flagging this. The branch had two extra commits that were unrelated to this fix (a check_provider_yaml_files.py namespaced-provider crash fix and a Jira provider.yaml conn-field fix) — those were already merged into main separately via #70224 and #70261, which is what caused the conflicts. I dropped both commits and rebased the actual KubernetesPodOperator dry_run fix cleanly onto latest main. The branch now only contains the two files relevant to this PR (pod.py and its test) and is mergeable. |
airflow dags test and dry_run() failed outside a cluster because build_pod_request_obj() unconditionally read hook.is_in_cluster to set the airflow_kpo_in_cluster label, which instantiates a Kubernetes API client and requires kube credentials/config to be available. A dry run should not need cluster access at all. closes: apache#45812
Aaryan123456679
force-pushed
the
fix/kpo-dry-run-kube-client-45812
branch
from
July 24, 2026 18:09
e91dc6e to
910515b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
airflow dags test(and callingKubernetesPodOperator.dry_run()directly) failed outside a real cluster becausebuild_pod_request_obj()unconditionally readhook.is_in_clusterto set theairflow_kpo_in_clusterlabel. That property instantiates a Kubernetes API client, which requires kube credentials/config to be available — something a dry run must not need.This adds a keyword-only
dry_runparameter tobuild_pod_request_obj()(defaultFalse, so existing callers are unaffected) and hasdry_run()skip theis_in_clusterlookup when set.closes: #45812