Bug 1276008 - [devexp_public_681]oc rsync cannot sync files to a not existed directory in pod with strategy tar
[devexp_public_681]oc rsync cannot sync files to a not existed directory in ...
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Build (Show other bugs)
3.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Cesar Wong
Wenjing Zheng
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-28 07:20 EDT by Wang Haoran
Modified: 2015-11-23 16:14 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-23 16:14:27 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Wang Haoran 2015-10-28 07:20:44 EDT
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):
oc v1.0.6-997-gff3b522
openshift v1.0.6-997-gff3b522
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4
etcd 2.1.2


How reproducible:
always

Steps to Reproduce:
1.create a project
2.create some pod
3.using oc rsync to sync files to pod not existed directory.
$touch /root/test/testfile
$oc rsync /root/test/ <pod>:/tmp/test/ --strategy='tar' --log-level=5

Actual results:
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

Expected results:

should synced same as rsync intalled locally.
Additional info:
Comment 1 Cesar Wong 2015-10-29 13:30:04 EDT
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:
https://github.com/openshift/openshift-docs/pull/1121
Comment 2 Wang Haoran 2015-10-29 21:24:49 EDT
ok, thanks for your docs pull , that will be clear .

Note You need to log in before you can comment on or make changes to this bug.