From f647d093c447adedf2301d14e24c1a20c5ba5485 Mon Sep 17 00:00:00 2001 From: Rewant Soni Date: Fri, 22 Nov 2024 11:33:31 +0530 Subject: [PATCH] controllers: add missing owner on sc and vsc Signed-off-by: Rewant Soni --- internal/controller/storageclaim_controller.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/controller/storageclaim_controller.go b/internal/controller/storageclaim_controller.go index 5db92bc8..7df660eb 100644 --- a/internal/controller/storageclaim_controller.go +++ b/internal/controller/storageclaim_controller.go @@ -365,6 +365,9 @@ func (r *StorageClaimReconciler) reconcilePhases() (reconcile.Result, error) { storageClass = r.getCephRBDStorageClass() } err = utils.CreateOrReplace(r.ctx, r.Client, storageClass, func() error { + if err := r.own(storageClass); err != nil { + return fmt.Errorf("failed to own Storage Class resource: %v", err) + } utils.AddLabels(storageClass, resource.Labels) utils.AddAnnotation(storageClass, storageClaimAnnotation, r.storageClaim.Name) storageClass.Parameters = data @@ -391,6 +394,9 @@ func (r *StorageClaimReconciler) reconcilePhases() (reconcile.Result, error) { volumeSnapshotClass = r.getCephRBDVolumeSnapshotClass() } err = utils.CreateOrReplace(r.ctx, r.Client, volumeSnapshotClass, func() error { + if err := r.own(volumeSnapshotClass); err != nil { + return fmt.Errorf("failed to own VolumeSnapshotClass resource: %v", err) + } utils.AddLabels(volumeSnapshotClass, resource.Labels) utils.AddAnnotation(volumeSnapshotClass, storageClaimAnnotation, r.storageClaim.Name) volumeSnapshotClass.Parameters = data