Skip to content

Commit

Permalink
fixup! add garbage collector runner to remove orphan PVs
Browse files Browse the repository at this point in the history
  • Loading branch information
ushitora-anqou committed Dec 3, 2024
1 parent 8571fe8 commit 1d60ebc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/controller/garbage_collector_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (r *GarbageCollectorRunner) isMantleRestoreAlreadyDeleted(ctx context.Conte
return false, fmt.Errorf("failed to find cluster ID: %s", pv.GetName())
}
if r.managedCephClusterID != clusterID {
return false, fmt.Errorf("PV is not managed by target Ceph cluster: %s: %s", clusterID, r.managedCephClusterID)
return false, nil
}

var restore mantlev1.MantleRestore
Expand Down
8 changes: 8 additions & 0 deletions internal/controller/garbage_collector_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ var _ = Describe("garbage collector", func() {
},
true, false,
),
Entry(
"cluster ID does not match",
true,
func(pv *corev1.PersistentVolume) {
pv.Spec.CSI.VolumeAttributes["clusterID"] = "different-cluster-id"
},
false, false,
),
)
})

Expand Down

0 comments on commit 1d60ebc

Please sign in to comment.