Merge pull request #10261 from rook/mergify/bp/release-1.9/pr-10246

osd: exit immediately if pvc block has not changed (backport #10246)
This commit is contained in:
mergify[bot] authored and GitHub committed 2022-05-12 18:22:11 +00:00
commit 71570f5871
1 file changed
+2 -1
+2 -1
View File
@@ -213,7 +213,8 @@ if [ -b "$PVC_DEST" ]; then
PVC_SOURCE_MAJ_MIN=$(stat --format '%%t%%T' $PVC_SOURCE)
PVC_DEST_MAJ_MIN=$(stat --format '%%t%%T' $PVC_DEST)
if [[ "$PVC_SOURCE_MAJ_MIN" == "$PVC_DEST_MAJ_MIN" ]]; then
CP_ARGS+=(--no-clobber)
echo "PVC $PVC_DEST already exists and has the same major and minor as $PVC_SOURCE: "$PVC_SOURCE_MAJ_MIN""
exit 0
else
echo "PVC's source major/minor numbers changed"
CP_ARGS+=(--remove-destination)