henry3260 commented on code in PR #76712:
URL: https://github.com/apache/airflow/pull/76712#discussion_r4542901605
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/hooks/kubernetes.py:
##########
@@ -935,7 +935,7 @@ async def _load_config(self):
in_cluster = self._coalesce_param(self.in_cluster, await
self._get_field("in_cluster"))
cluster_context = self._coalesce_param(self.cluster_context, await
self._get_field("cluster_context"))
- kubeconfig_path = await self._get_field("kube_config_path")
+ kubeconfig_path = self._coalesce_param(self.config_file, await
self._get_field("kube_config_path"))
Review Comment:
`config_file` can now be what trips the check below, but the message still
lists only `kube_config_path`, `kube_config`, `in_cluster` and `config_dict`
someone who passed `config_file` plus `in_cluster` gets back a list of options
they never set. Could we add `config_file` to it? The sync hook's copy of the
message in `get_conn` has the same gap, so it's probably worth fixing both.
##########
providers/cncf/kubernetes/docs/changelog.rst:
##########
@@ -27,6 +27,14 @@
Changelog
---------
+.. note::
Review Comment:
The note says the triggerer must be able to read the file, but not what to
do if it can't. Could we add the two ways out? Either mount the same kubeconfig
on the triggerer at that path, or drop config_file and put the kubeconfig
contents in the connection's kube_config extra, which needs no shared
filesystem. Might be worth adding that the connection's kube_config_path is not
a third option, since that is also a path the triggerer has to resolve.
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/hooks/kubernetes.py:
##########
@@ -935,7 +935,7 @@ async def _load_config(self):
in_cluster = self._coalesce_param(self.in_cluster, await
self._get_field("in_cluster"))
cluster_context = self._coalesce_param(self.cluster_context, await
self._get_field("cluster_context"))
- kubeconfig_path = await self._get_field("kube_config_path")
Review Comment:
These four lines are now the same as `KubernetesHook.get_conn` above, and
drift between the two copies is exactly what this PR is fixing the sync one
honored `config_file`, this one didn't. A small shared helper for the
mutual-exclusion check would stop them diverging again.
Fine as a follow-up though no need to grow a one-line fix.
--
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]