Skip to content

Commit

Permalink
controllers: skip checking for vgsc if the crd is not present
Browse files Browse the repository at this point in the history
Signed-off-by: Rewant Soni <[email protected]>
  • Loading branch information
rewantsoni committed Feb 25, 2025
1 parent 3d7105e commit 00f12f8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/controller/storageclaim_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -705,6 +705,9 @@ func (r *StorageClaimReconciler) hasVolumeSnapshotContents() (bool, error) {
}

func (r *StorageClaimReconciler) hasVolumeGroupSnapshotContents() (bool, error) {
if !r.AvailableCrds[VolumeGroupSnapshotClassCrdName] {
return false, nil
}
vscList := &groupsnapapi.VolumeGroupSnapshotContentList{}
if err := r.list(vscList, client.MatchingFields{vgscClusterIDIndexName: r.storageClaimHash}); err != nil {
return false, fmt.Errorf("failed to list volume group snapshot content resources: %v", err)
Expand Down

0 comments on commit 00f12f8

Please sign in to comment.