Skip to content

Commit

Permalink
Merge pull request #1318 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…1316-to-release-0.10

[release-0.10] fix rsync-tls copy files that start with '#'
  • Loading branch information
openshift-merge-bot[bot] authored Jun 25, 2024
2 parents af6cd31 + 7580b9e commit a8fc40f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mover-rsync-tls/client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ while [[ $rc -ne 0 && $RETRY -lt $MAX_RETRIES ]]; do
/diskrsync-tcp $BLOCK_SOURCE --source --target-address 127.0.0.1 --port $STUNNEL_LISTEN_PORT
rc=$?
else
ls -A "${SOURCE}"/ > /tmp/filelist.txt
# Find all files/dirs at root of pvc, prepend / to each (rsync will use SOURCE as the base dir for these files)
find "${SOURCE}" -mindepth 1 -maxdepth 1 -printf '/%P\n' > /tmp/filelist.txt
if [[ -s /tmp/filelist.txt ]]; then
# 1st run preserves as much as possible, but excludes the root directory
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
Expand Down
18 changes: 18 additions & 0 deletions test-e2e/test_rsync_tls_normal_manyfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,24 @@
file_count: 21000
pvc_name: 'data-source'

- name: Write file that starts with a hash char
include_role:
name: write_to_pvc
vars:
data: '000111'
path: '/#filestartswithhash'
file_count: 1
pvc_name: 'data-source'

- name: Write dir that starts with a hash char
include_role:
name: write_to_pvc
vars:
data: '222333444555'
path: '/#dirtartswithhash/#subfile'
file_count: 1
pvc_name: 'data-source'

- name: Wait for key and address to be ready
kubernetes.core.k8s_info:
api_version: volsync.backube/v1alpha1
Expand Down

0 comments on commit a8fc40f

Please sign in to comment.