diff --git a/changelogs/fragments/223-add-deprecation-notice.yaml b/changelogs/fragments/223-add-deprecation-notice.yaml new file mode 100644 index 0000000000..8c3b7ac64d --- /dev/null +++ b/changelogs/fragments/223-add-deprecation-notice.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: + - k8s_exec - add missing deprecation notice to return_code for k8s_exec (https://github.com/ansible-collections/kubernetes.core/pull/233). diff --git a/plugins/modules/k8s_exec.py b/plugins/modules/k8s_exec.py index bdb8418ddd..3ce10d0f94 100644 --- a/plugins/modules/k8s_exec.py +++ b/plugins/modules/k8s_exec.py @@ -31,7 +31,7 @@ - "PyYAML >= 3.11" notes: - - Return code C(rc) for the command executed is added in output in version 2.3.0, and depricates return code C(return_code). + - Return code C(rc) for the command executed is added in output in version 2.2.0, and deprecates return code C(return_code). - Return code C(return_code) for the command executed is added in output in version 1.0.0. - The authenticated user must have at least read access to the pods resource and write access to the pods/exec resource. @@ -110,7 +110,7 @@ type: int version_added: 2.3.0 return_code: - description: The command status code. This attribute is depricated and will remove in future release. Please use rc instead. + description: The command status code. This attribute is deprecated and will be removed in a future release. Please use rc instead. type: int ''' @@ -183,6 +183,7 @@ def execute_module(module, k8s_ansible_mixin): else: rc = int(err['details']['causes'][0]['message']) + module.deprecate("The 'return_code' return key is deprecated. Please use 'rc' instead.", version="4.0.0", collection_name="kubernetes.core") module.exit_json( # Some command might change environment, but ultimately failing at end changed=True,