Red Hat Bugzilla – Bug 1276008
[devexp_public_681]oc rsync cannot sync files to a not existed directory in pod with strategy tar
Last modified: 2015-11-23 16:14:27 EST
Description of problem:
oc rsync cannot sync files to a not existed directory in pod when the rsync command not installed locally, but it works when rsync installed locally.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.create a project
2.create some pod
3.using oc rsync to sync files to pod not existed directory.
$oc rsync /root/test/ <pod>:/tmp/test/ --strategy='tar' --log-level=5
failed to sync with error:
[root@ip-172-18-2-7 ~]# oc rsync /root/test/ ruby-hello-world-2-udfux:/tmp/test --loglevel=5 --strategy='tar'
I1028 07:03:18.786503 1266 copytar.go:74] Copying files with tar
I1028 07:03:18.786729 1266 copytar.go:90] Creating local tar file /tmp/rsync202323105 from local path /root/test/
I1028 07:03:18.786741 1266 copytar.go:153] Tarring /root/test/ locally
I1028 07:03:18.786795 1266 tar.go:155] Adding to tar: /root/test/testfile as testfile
I1028 07:03:18.786868 1266 copytar.go:118] Untarring temp file /tmp/rsync202323105 to remote directory /tmp/test
I1028 07:03:18.786881 1266 copytar.go:175] Extracting tar remotely with command: tar -C /tmp/test -x -v
I1028 07:03:18.786887 1266 execremote.go:28] Remote executor running command: tar -C /tmp/test -x -v
I1028 07:03:18.790358 1266 exec.go:180] defaulting container name to ruby-hello-world
tar: /tmp/test: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
I1028 07:03:18.919426 1266 execremote.go:49] Error from remote execution: error executing remote command: Error executing command in container: Error executing in Docker Container: 2
F1028 07:03:18.919535 1266 helpers.go:96] error: error extracting tar at destination directory: error executing remote command: Error executing command in container: Error executing in Docker Container: 2
should synced same as rsync intalled locally.
Wang, this is going to be working as designed. We don't intend to replicate the functionality of rsync using tar. We will warn you that you should use rsync if possible. However, there's too many differences between the function of rsync and tar that it won't be feasible to try to implement them via our client. I mentioned this in my doc update here:
ok, thanks for your docs pull , that will be clear .