File tree Expand file tree Collapse file tree
roles/compare_pvc_data/templates Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7777START_TIME=$SECONDS
7878case " ${DIRECTION} " in
7979source)
80- find " ${MOUNT_PATH} " -path " ${MOUNT_PATH} /lost+found" -prune -o -print | getfacl -P - > /tmp/permissions.facl
80+ find " ${MOUNT_PATH} " -path " ${MOUNT_PATH} /lost+found" -prune -o -not -type l - print | getfacl -P - > /tmp/permissions.facl
8181 rclone sync " ${RCLONE_FLAGS_SYNC[@]} " --exclude " lost+found/**" " ${MOUNT_PATH} " " ${RCLONE_CONFIG_SECTION} :${RCLONE_DEST_PATH} " --log-level DEBUG
8282 rclone copy " ${RCLONE_FLAGS_COPY[@]} " --include permissions.facl /tmp " ${RCLONE_CONFIG_SECTION} :${RCLONE_DEST_PATH} " --log-level DEBUG
8383 ;;
Original file line number Diff line number Diff line change 3838
3939 echo "... all file contents matched"
4040
41+ {% if not skip_symlink_check | default (false ) %}
4142 echo "Validating symlinks: PVC1 -> PVC2"
4243 find /mnt -type l | { grep -v lost+found || true; } | sort | while IFS= read -r f; do
4344 f2=$(echo "$f" | sed 's|^/mnt/|/mnt2/|')
@@ -64,13 +65,24 @@ spec:
6465 done
6566
6667 echo "... all symlinks matched"
68+ {% else %}
69+ echo "Skipping symlink validation (skip_symlink_check=true)"
70+ {% endif %}
6771
6872 echo "File attributes:"
73+ {% if skip_symlink_check | default (false ) %}
74+ find /mnt -not -type l -exec stat -c "{{ properties_to_verify }}" {} \; | \
75+ {% else %}
6976 find /mnt -exec stat -c "{{ properties_to_verify }}" {} \; | \
77+ {% endif %}
7078 grep -v lost+found | \
7179 sort | tee /tmp/attributes-mnt
7280 sed -ri 's|/mnt|/mnt2|' /tmp/attributes-mnt
81+ {% if skip_symlink_check | default (false ) %}
82+ find /mnt2 -not -type l -exec stat -c "{{ properties_to_verify }}" {} \; | \
83+ {% else %}
7384 find /mnt2 -exec stat -c "{{ properties_to_verify }}" {} \; | \
85+ {% endif %}
7486 grep -v lost+found | \
7587 sort > /tmp/attributes-mnt2
7688
Original file line number Diff line number Diff line change 4747 requests :
4848 storage : 1Gi
4949
50- - name : Write data into the source PVC
50+ - name : Write data and symlinks into the source PVC
5151 include_role :
5252 name : write_to_pvc
5353 vars :
5454 data : ' data'
5555 path : ' /datafile'
5656 pvc_name : ' data-source'
57+ symlinks :
58+ - path : ' /mysql.sock'
59+ target : ' /var/run/mysqld/mysqld.sock'
60+ - path : ' /link-relative'
61+ target : ' datafile'
5762
5863 - name : Sync data from source volume (w/ mSC)
5964 kubernetes.core.k8s :
242247 pvc1_name : data-source
243248 pvc2_name : data-dest
244249 timeout : 900
250+ skip_symlink_check : true
Original file line number Diff line number Diff line change 5050 requests :
5151 storage : 1Gi
5252
53- - name : Write data into the source PVC
53+ - name : Write data and symlinks into the source PVC
5454 include_role :
5555 name : write_to_pvc
5656 vars :
5757 data : ' data'
5858 path : ' /datafile'
5959 pvc_name : ' data-source'
60+ symlinks :
61+ - path : ' /mysql.sock'
62+ target : ' /var/run/mysqld/mysqld.sock'
63+ - path : ' /link-relative'
64+ target : ' datafile'
6065
6166 - name : Sync data from source volume
6267 kubernetes.core.k8s :
184189 pvc1_name : data-source
185190 pvc2_name : data-dest
186191 timeout : 900
192+ skip_symlink_check : true
You can’t perform that action at this time.
0 commit comments