Skip to content

Commit

Permalink
k8s_cp - fix issue when using local_path (ansible-collections#422)
Browse files Browse the repository at this point in the history
k8s_cp - fix issue when using local_path

SUMMARY

When copying from local path to pod, the file is found on the controller node instead of the managed node.
This PR aims to resolve this issue.
Fixes ansible-collections#421

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

k8s_cp

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Mike Graves <mgraves@redhat.com>
  • Loading branch information
abikouo authored Apr 4, 2022
1 parent 764e449 commit 1d05cf5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- k8s_cp - fix issue when using parameter local_path with file on managed node. (https://github.com/ansible-collections/kubernetes.core/issues/421).
2 changes: 1 addition & 1 deletion plugins/action/k8s_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def run(self, tmp=None, task_vars=None):

local_path = self._task.args.get("local_path")
state = self._task.args.get("state", None)
if local_path and state == "to_pod":
if local_path and state == "to_pod" and not remote_transport:
new_module_args["local_path"] = self.get_file_realpath(local_path)

# Execute the k8s_* module.
Expand Down

0 comments on commit 1d05cf5

Please sign in to comment.