rjgoyln opened a new pull request, #76712: URL: https://github.com/apache/airflow/pull/76712
Re-files #72301, which was closed by the open PR limit. ## Summary `AsyncKubernetesHook._load_config` ignores `config_file`, so a deferrable `KubernetesJobOperator` given an explicit kubeconfig authenticates with the connection's `kube_config_path` or the default kubeconfig instead. Within one `KubernetesJobTrigger`, the sync pod manager reads the requested file while the async hook does not. `config_file` now takes precedence over the connection's `kube_config_path`, matching the sync hook. `KubernetesPodOperator` is unaffected because it turns `config_file` into `config_dict` before deferring. With `KUBECONFIG` and `config_file` pointing at different clusters, the hook connects to: ``` before: https://default-cluster.invalid:6443 after: https://requested-cluster.invalid:6443 ``` ## Behavior change The triggerer now reads `config_file` even without `do_xcom_push`, and combining it with `in_cluster`, `kube_config` or `config_dict` raises instead of being silently ignored. ## Tests - `test_load_config_with_config_file`: `config_file` reaches `load_kube_config`, with and without a connection `kube_config_path`. - `test_load_config_with_mutually_exclusive_params`: `config_file` plus `in_cluster`, `config_dict` or `kube_config` raises the mutual-exclusion error. All five cases fail against main's hook. The replaced `test_load_config_with_several_params` never reached that check: its connection lookup raised first and satisfied the bare `AirflowException` assertion. --- ##### Was generative AI tooling used to co-author this PR? - [X] Yes — Claude Code (Opus 5.5) Generated-by: Claude Code (Opus 5.5) following [the guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions) -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
