Skip to content

Commit

Permalink
fix: change disable_verify_ssl behaviour
Browse files Browse the repository at this point in the history
The problem is that verify_ssl is overwritten by the
configuration from the kube_config or load_incluster_config file.
  • Loading branch information
wselfjes committed Jul 22, 2022
1 parent d85cd3d commit cb3510b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions airflow/kubernetes/kube_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
has_kubernetes = True

def _disable_verify_ssl() -> None:
configuration = Configuration()
configuration = Configuration.get_default_copy()
configuration.verify_ssl = False
Configuration.set_default(configuration)

Expand Down Expand Up @@ -100,9 +100,6 @@ def get_kube_client(
if conf.getboolean('kubernetes', 'enable_tcp_keepalive'):
_enable_tcp_keepalive()

if not conf.getboolean('kubernetes', 'verify_ssl'):
_disable_verify_ssl()

if in_cluster:
config.load_incluster_config()
else:
Expand All @@ -112,4 +109,7 @@ def get_kube_client(
config_file = conf.get('kubernetes', 'config_file', fallback=None)
config.load_kube_config(config_file=config_file, context=cluster_context)

if not conf.getboolean('kubernetes', 'verify_ssl'):
_disable_verify_ssl()

return client.CoreV1Api()

0 comments on commit cb3510b

Please sign in to comment.