Skip to content

Commit

Permalink
Merge pull request #277 from rewantsoni/fix-owner
Browse files Browse the repository at this point in the history
controllers: add missing owner on sc and vsc
  • Loading branch information
openshift-merge-bot[bot] authored Nov 22, 2024
2 parents 10c81ce + f647d09 commit 3a378e8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/controller/storageclaim_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3a378e8

Please sign in to comment.