mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-07-28 10:24:45 +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:
2
changelogs/fragments/223-k8s-cp-uploading.yaml
Normal file
2
changelogs/fragments/223-k8s-cp-uploading.yaml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
bugfixes:
|
||||||
|
- k8s_cp - fix k8s_cp uploading when target container's WORKDIR is not '/' (https://github.com/ansible-collections/kubernetes.core/issues/222).
|
||||||
@@ -370,6 +370,9 @@ class K8SCopyToPod(K8SCopy):
|
|||||||
else:
|
else:
|
||||||
tar_command = ['tar', '-xmf', '-']
|
tar_command = ['tar', '-xmf', '-']
|
||||||
|
|
||||||
|
if dest_file.startswith("/"):
|
||||||
|
tar_command.extend(['-C', '/'])
|
||||||
|
|
||||||
response = stream(self.api_instance.connect_get_namespaced_pod_exec,
|
response = stream(self.api_instance.connect_get_namespaced_pod_exec,
|
||||||
self.name,
|
self.name,
|
||||||
self.namespace,
|
self.namespace,
|
||||||
|
|||||||
Reference in New Issue
Block a user