mirror of
https://github.com/ansible-collections/kubernetes.core.git
synced 2026-04-26 00:06:26 +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:
|
||||
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