mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-03-26 21:33:02 +00:00
fix k8s_cp uploading when target container's WORKDIR is other than '/' (#223)
fix k8s_cp uploading when deployed container's WORKDIR is other than '/' SUMMARY fix #222 ISSUE TYPE Bugfix Pull Request COMPONENT NAME k8s_cp ADDITIONAL INFORMATION Reviewed-by: Mike Graves <mgraves@redhat.com> Reviewed-by: None <None> Reviewed-by: None <None>
This commit is contained in:
@@ -370,6 +370,9 @@ class K8SCopyToPod(K8SCopy):
|
||||
else:
|
||||
tar_command = ['tar', '-xmf', '-']
|
||||
|
||||
if dest_file.startswith("/"):
|
||||
tar_command.extend(['-C', '/'])
|
||||
|
||||
response = stream(self.api_instance.connect_get_namespaced_pod_exec,
|
||||
self.name,
|
||||
self.namespace,
|
||||
|
||||
Reference in New Issue
Block a user