Skip to content

Commit

Permalink
add kubernetes version check for no_proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
itaru2622 committed Nov 8, 2021
1 parent 02ac37a commit 96fe7db
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/module_utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@ def _load_config():
# Removing trailing slashes if any from hostname
auth["host"] = auth.get("host").rstrip("/")

if auth_set("no_proxy") and LooseVersion(kubernetes.__version__) < LooseVersion("19.15.0"):
_raise_or_fail(
Exception(
"kubernetes >= 19.15.0 is required to use no_proxy feature."
),
"Failed to set no_proxy due to: %s",
)

if auth_set("username", "password", "host") or auth_set("api_key", "host"):
# We have enough in the parameters to authenticate, no need to load incluster or kubeconfig
pass
Expand Down

0 comments on commit 96fe7db

Please sign in to comment.