From 0c7b89a44eb522bce57d65bb6d7ac6ee88d5a17d Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Thu, 29 Jan 2026 16:25:52 -0500 Subject: [PATCH] Fix VolumePolicy PVC phase condition filter for unbound PVCs Use typed error approach: Make GetPVForPVC return ErrPVNotFoundForPVC when PV is not expected to be found (unbound PVC), then use errors.Is to check for this error type. When a matching policy exists (e.g., pvcPhase: [Pending, Lost] with action: skip), apply the action without error. When no policy matches, return the original error to preserve default behavior. Changes: - Add ErrPVNotFoundForPVC sentinel error to pvc_pv.go - Update ShouldPerformSnapshot to handle unbound PVCs with policies - Update ShouldPerformFSBackup to handle unbound PVCs with policies - Update item_backupper.go to handle Lost PVCs in tracking functions - Remove checkPVCOnlySkip helper (no longer needed) - Update tests to reflect new behavior Signed-off-by: Tiger Kaovilai Co-Authored-By: Claude Opus 4.5 --- changelogs/unreleased/9508-kaovilai | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/unreleased/9508-kaovilai diff --git a/changelogs/unreleased/9508-kaovilai b/changelogs/unreleased/9508-kaovilai new file mode 100644 index 000000000..3c224aee3 --- /dev/null +++ b/changelogs/unreleased/9508-kaovilai @@ -0,0 +1 @@ +Fix VolumePolicy PVC phase condition filter for unbound PVCs (#9507)