diff --git a/changelogs/fragments/151-check-auth-params-for-existence.yaml b/changelogs/fragments/151-check-auth-params-for-existence.yaml new file mode 100644 index 00000000..d251f08f --- /dev/null +++ b/changelogs/fragments/151-check-auth-params-for-existence.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: + - check auth params for existence, not whether they are true (https://github.com/ansible-collections/kubernetes.core/pull/151). diff --git a/plugins/module_utils/common.py b/plugins/module_utils/common.py index e3a48cca..48e55ec0 100644 --- a/plugins/module_utils/common.py +++ b/plugins/module_utils/common.py @@ -124,7 +124,7 @@ def get_api_client(module=None, **kwargs): # If authorization variables aren't defined, look for them in environment variables for true_name, arg_name in AUTH_ARG_MAP.items(): - if module and module.params.get(arg_name): + if module and module.params.get(arg_name) is not None: auth[true_name] = module.params.get(arg_name) elif arg_name in kwargs and kwargs.get(arg_name) is not None: auth[true_name] = kwargs.get(arg_name)