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:
itaru2622
2021-09-14 01:51:43 +09:00
committed by GitHub
parent 07ac24e42e
commit db11675622
2 changed files with 5 additions and 0 deletions

View File

@@ -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,