[ 
https://issues.apache.org/jira/browse/AIRFLOW-5501?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17017306#comment-17017306
 ] 

ASF subversion and git services commented on AIRFLOW-5501:
----------------------------------------------------------

Commit e54fba5b479e36ecad6afb8d3920a534af6e6135 in airflow's branch 
refs/heads/master from Quentin Lemaire
[ https://gitbox.apache.org/repos/asf?p=airflow.git;h=e54fba5 ]

[AIRFLOW-5501] Make default `in_cluster` value in KubernetesPodOperator respect 
config (#6124)

The default value of the parameter in_cluster of the
kube_client.get_kube_client function is
in_cluster=conf.getboolean('kubernetes', 'in_cluster'). Therefore, the
expected behavior is that when, in_cluster is not set, it takes the
value in the configuration file.

However, the default value of in_cluster in KubernetesPodOperator.py is
False and in_cluster is passed as a parameter when calling the
kube_client.get_kube_client function. Therefore, it changes the
expecting behavior by overwritting the default value. When in_cluster is
not set when initializing KubernetesPodOperator, the value of in_cluster
in kube_client.get_kube_client is False and not the value which is in
the configuration file.

Therefore, the default value of in_cluster in KubernetesPodOperator has
been changed to None and will not be passed to get_kube_client if it is
not overwritten so that it takes the configuration value as a default
value.

Co-authored-by: Ash Berlin-Taylor <ash_git...@firemirror.com>

> in_cluster default value in KubernetesPodOperator overwrites configuration
> --------------------------------------------------------------------------
>
>                 Key: AIRFLOW-5501
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-5501
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: contrib
>    Affects Versions: 1.10.5
>            Reporter: Quentin Lemaire
>            Priority: Major
>             Fix For: 1.10.8
>
>
> Hi!
> The default value of the parameter *in_cluster* of the 
> *kube_client.get_kube_client* function is 
> *in_cluster=conf.getboolean('kubernetes', 'in_cluster').* Therefore, the 
> expected behavior is that when, *in_cluster* is not set, it takes the value 
> in the configuration file.
> However, the default value of *in_cluster* in *KubernetesPodOperator.py* is 
> False and *in_cluster* is passed as a parameter when calling the 
> *kube_client.get_kube_client* function. Therefore, it changes the expecting 
> behavior by overwritting the default value. When *in_cluster* is not set when 
> initializing *KubernetesPodOperator*, the value of *in_cluster* in 
> *kube_client.get_kube_client* is False and not the value which is in the 
> configuration file.
> It is quite confusing because it can feel like the value in the configuration 
> file is not working properly.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to