From d375feee3b34f2bd6304a7b53f50f3d1be721314 Mon Sep 17 00:00:00 2001 From: Bikouo Aubin <79859644+abikouo@users.noreply.github.com> Date: Tue, 17 Dec 2024 17:50:22 +0100 Subject: [PATCH] Remove kubeconfig value from module invocation log (#826) (cherry picked from commit 6efabd3418cbee9b96430d8374bf16738e48b04e) --- changelogs/fragments/20241213-kubeconfig-set-no_log-true.yaml | 3 +++ plugins/module_utils/args_common.py | 2 +- plugins/module_utils/helm_args_common.py | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/20241213-kubeconfig-set-no_log-true.yaml diff --git a/changelogs/fragments/20241213-kubeconfig-set-no_log-true.yaml b/changelogs/fragments/20241213-kubeconfig-set-no_log-true.yaml new file mode 100644 index 0000000000..4496184470 --- /dev/null +++ b/changelogs/fragments/20241213-kubeconfig-set-no_log-true.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: + - kubeconfig option should not appear in module invocation log (https://github.com/ansible-collections/kubernetes.core/issues/782). diff --git a/plugins/module_utils/args_common.py b/plugins/module_utils/args_common.py index 27f4eacc8a..c3114f3cea 100644 --- a/plugins/module_utils/args_common.py +++ b/plugins/module_utils/args_common.py @@ -18,7 +18,7 @@ def list_dict_str(value): ) AUTH_ARG_SPEC = { - "kubeconfig": {"type": "raw"}, + "kubeconfig": {"type": "raw", "no_log": True}, "context": {}, "host": {}, "api_key": {"no_log": True}, diff --git a/plugins/module_utils/helm_args_common.py b/plugins/module_utils/helm_args_common.py index ebf8e9f56a..277be01d25 100644 --- a/plugins/module_utils/helm_args_common.py +++ b/plugins/module_utils/helm_args_common.py @@ -16,6 +16,7 @@ type="raw", aliases=["kubeconfig_path"], fallback=(env_fallback, ["K8S_AUTH_KUBECONFIG"]), + no_log=True, ), host=dict(type="str", fallback=(env_fallback, ["K8S_AUTH_HOST"])), ca_cert=dict(