Skip to content

controllers: implement upgrade controller for provider mode #3142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

rewantsoni
Copy link
Member

This commit fixes small issues with the upgrade controller and removesthe ownerRef of the StorageRequest from the SVG CR

Comment on lines 157 to 171
//Delete the ownerRef on the resources svg
svg := &metav1.PartialObjectMetadata{}
svg.SetGroupVersionKind(rookCephv1.SchemeGroupVersion.WithKind("CephFilesystemSubVolumeGroup"))
svg.Name = svgName
if err := r.Client.Get(ctx, client.ObjectKeyFromObject(storageConsumer), svg); client.IgnoreNotFound(err) != nil {
return reconcile.Result{}, err
}
if svg.UID != "" {
refs := svg.GetOwnerReferences()
if idx := slices.IndexFunc(refs, func(owner metav1.OwnerReference) bool {
return owner.Kind == "StorageRequest"
}); idx != -1 {
svg.SetOwnerReferences(slices.Delete(refs, idx, idx+1))
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Why is this code located here? it has nothing to do with filling in the CM
  • I don't see any code that applies the change. As the code stands now this is only an in memory change.

@rewantsoni rewantsoni force-pushed the upgrade-controller branch 2 times, most recently from 845bc29 to a8e0da2 Compare April 9, 2025 12:52
@rewantsoni rewantsoni force-pushed the upgrade-controller branch 4 times, most recently from 96c1745 to 5204aa7 Compare April 10, 2025 15:53
@rewantsoni rewantsoni force-pushed the upgrade-controller branch 2 times, most recently from 97828b6 to f613f6e Compare April 14, 2025 10:17
@rewantsoni rewantsoni changed the title controllers: remove owner ref on svg CR of provider mode controllers: implement upgrade controller for provider mode Apr 14, 2025
This commit fixes small issues with upgrade contoller and removes
ownerRef of StorageRequest from svg and rns CR and deletes the
storageRequest

Signed-off-by: Rewant Soni <resoni@redhat.com>
@nb-ohad
Copy link
Contributor

nb-ohad commented Apr 14, 2025

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 14, 2025
Copy link
Contributor

openshift-ci bot commented Apr 14, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nb-ohad, rewantsoni

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 14, 2025
@rewantsoni
Copy link
Member Author

/cherry-pick release-4.19

@openshift-cherrypick-robot

@rewantsoni: once the present PR merges, I will cherry-pick it on top of release-4.19 in a new PR and assign it to you.

In response to this:

/cherry-pick release-4.19

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@openshift-merge-bot openshift-merge-bot bot merged commit 133afbe into red-hat-storage:main Apr 14, 2025
11 checks passed
@openshift-cherrypick-robot

@rewantsoni: new pull request created: #3159

In response to this:

/cherry-pick release-4.19

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants