Skip to content

Commit a8fc40f

Browse files
Merge pull request #1318 from openshift-cherrypick-robot/cherry-pick-1316-to-release-0.10
[release-0.10] fix rsync-tls copy files that start with '#'
2 parents af6cd31 + 7580b9e commit a8fc40f

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

mover-rsync-tls/client.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ while [[ $rc -ne 0 && $RETRY -lt $MAX_RETRIES ]]; do
149149
/diskrsync-tcp $BLOCK_SOURCE --source --target-address 127.0.0.1 --port $STUNNEL_LISTEN_PORT
150150
rc=$?
151151
else
152-
ls -A "${SOURCE}"/ > /tmp/filelist.txt
152+
# Find all files/dirs at root of pvc, prepend / to each (rsync will use SOURCE as the base dir for these files)
153+
find "${SOURCE}" -mindepth 1 -maxdepth 1 -printf '/%P\n' > /tmp/filelist.txt
153154
if [[ -s /tmp/filelist.txt ]]; then
154155
# 1st run preserves as much as possible, but excludes the root directory
155156
rsync -aAhHSxz -r --exclude=lost+found --itemize-changes --info=stats2,misc2 --files-from=/tmp/filelist.txt ${SOURCE}/ rsync://127.0.0.1:$STUNNEL_LISTEN_PORT/data

test-e2e/test_rsync_tls_normal_manyfiles.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,24 @@
113113
file_count: 21000
114114
pvc_name: 'data-source'
115115

116+
- name: Write file that starts with a hash char
117+
include_role:
118+
name: write_to_pvc
119+
vars:
120+
data: '000111'
121+
path: '/#filestartswithhash'
122+
file_count: 1
123+
pvc_name: 'data-source'
124+
125+
- name: Write dir that starts with a hash char
126+
include_role:
127+
name: write_to_pvc
128+
vars:
129+
data: '222333444555'
130+
path: '/#dirtartswithhash/#subfile'
131+
file_count: 1
132+
pvc_name: 'data-source'
133+
116134
- name: Wait for key and address to be ready
117135
kubernetes.core.k8s_info:
118136
api_version: volsync.backube/v1alpha1

0 commit comments

Comments
 (0)