Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deprecation notice to k8s_exec #233

Merged
merged 3 commits into from
Sep 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelogs/fragments/223-add-deprecation-notice.yaml
Original file line number Diff line number Diff line change
@@ -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).
5 changes: 3 additions & 2 deletions plugins/modules/k8s_exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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
'''

Expand Down Expand Up @@ -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")
abikouo marked this conversation as resolved.
Show resolved Hide resolved
module.exit_json(
# Some command might change environment, but ultimately failing at end
changed=True,
Expand Down