Flatten ProvisionerReference#544
Conversation
ProvisionerReference contains a single required field. We can simplify the object model by moving the ObjectRef for a provisioner up one level.
|
Question: would we prefer an ObjectReference or a ProvisionerReference (like so): |
|
@evankanderson good question. The main difference will be in how we handle upgrades for |
|
I think the idea is that a In particular, CRDs today do not permit multiple apiVersions for the same |
|
My preference would be to try to use ObjectReference (as that's the normal way to do refs in k8s) unless there's a very good reason not to. Seems like if there's a new version of the provisioner, that might be important to distinguish. Perhaps we could still use the ObjectReference but only use certain fields of it if we want to be able to handle multiple versions of the referenced object? |
|
Oh, and the version is necessary to reference an object. Unless we have some logic to see what's available from the server and then try each of them for example, so it's not only for different representation of the object. |
|
+1 on /lgtm |
|
@n3wscott fixed the conflict, PTAL |
| func IsControlled(ref *eventingv1alpha1.ProvisionerReference, kind string) bool { | ||
| if ref != nil && ref.Ref != nil { | ||
| return shouldReconcile(ref.Ref.Namespace, ref.Ref.Name, kind) | ||
| func IsControlled(ref *corev1.ObjectReference, kind string) bool { |
There was a problem hiding this comment.
what is kind in this context? Isn't it just ref.Kind?
There was a problem hiding this comment.
@vaikas-google We haven't updated ClusterProvisioner to ClusterChannelProvisioner yet, the kind should go away with that PR.
As currently implement the only value passed in is "Channel" which the shouldReconcile method then checks to make sure it is indeed channel.
There was a problem hiding this comment.
we could just change L111 to pass in ref.Kind and ignore the kind but it's busy work with that PR :)
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: scothis, vaikas-google The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@n3wscott care to remove the hold, or do you have remaining concerns? |
|
Updated to resolve new conflicts |
|
Updated to resolve new conflicts (again) |
|
/lgtm |
|
/hold cancel @n3wscott if you have further concerns I can follow up in a new PR |
Co-authored-by: Christoph Stäbler <cstabler@redhat.com>
ProvisionerReference contains a single required field. We can simplify
the object model by moving the ObjectRef for a provisioner up one level.
Release Note
/assign @n3wscott