-
Notifications
You must be signed in to change notification settings - Fork 185
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
controllers: implement upgrade controller for provider mode #3142
Conversation
//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)) | ||
} | ||
} |
There was a problem hiding this comment.
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.
845bc29
to
a8e0da2
Compare
controllers/storageconsumer/storageconsumer_upgrade_controller.go
Outdated
Show resolved
Hide resolved
controllers/storageconsumer/storageconsumer_upgrade_controller.go
Outdated
Show resolved
Hide resolved
controllers/storageconsumer/storageconsumer_upgrade_controller.go
Outdated
Show resolved
Hide resolved
96c1745
to
5204aa7
Compare
controllers/storageconsumer/storageconsumer_upgrade_controller.go
Outdated
Show resolved
Hide resolved
97828b6
to
f613f6e
Compare
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>
f613f6e
to
00a7229
Compare
/lgtm |
[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 |
/cherry-pick release-4.19 |
@rewantsoni: once the present PR merges, I will cherry-pick it on top of In response to this:
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. |
133afbe
into
red-hat-storage:main
@rewantsoni: new pull request created: #3159 In response to this:
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. |
This commit fixes small issues with the upgrade controller and removesthe ownerRef of the StorageRequest from the SVG CR