Skip to content

Flatten ProvisionerReference#544

Merged
knative-prow-robot merged 4 commits into
knative:masterfrom
scothis:provisioner-ref
Oct 26, 2018
Merged

Flatten ProvisionerReference#544
knative-prow-robot merged 4 commits into
knative:masterfrom
scothis:provisioner-ref

Conversation

@scothis
Copy link
Copy Markdown
Contributor

@scothis scothis commented Oct 23, 2018

ProvisionerReference contains a single required field. We can simplify
the object model by moving the ObjectRef for a provisioner up one level.

Release Note

NONE

/assign @n3wscott

ProvisionerReference contains a single required field. We can simplify
the object model by moving the ObjectRef for a provisioner up one level.
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Oct 23, 2018
@knative-prow-robot knative-prow-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 23, 2018
@evankanderson
Copy link
Copy Markdown
Member

Question: would we prefer an ObjectReference or a ProvisionerReference (like so):

type ProvisionerReference struct {
  Name string `json: "name"`
  ClusterName string `json: "clusterName"`
}

@scothis
Copy link
Copy Markdown
Contributor Author

scothis commented Oct 23, 2018

@evankanderson good question. The main difference will be in how we handle upgrades for ClusterChannelProvisioner from v1alpha1 to v1alpha2. I don't have a strong opinion here.

@evankanderson
Copy link
Copy Markdown
Member

I think the idea is that a name, Kind and api group (e.g. eventing.knative.dev, without the version) is sufficient to reference an object, and that v1alpha1 and v1alpha2 would reference the same object with a different representation.

In particular, CRDs today do not permit multiple apiVersions for the same Kind and api group that have different schema.

@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented Oct 24, 2018

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?

@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented Oct 24, 2018

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.

@n3wscott
Copy link
Copy Markdown
Contributor

+1 on ObjectReference because it plugs into lots of other helpful tooling we have that would have to be coded around to get the same integration if we just name/clustername.

/lgtm
/hold
need to fix the conflict.

@knative-prow-robot knative-prow-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. labels Oct 24, 2018
@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 24, 2018
@scothis
Copy link
Copy Markdown
Contributor Author

scothis commented Oct 24, 2018

@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 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what is kind in this context? Isn't it just ref.Kind?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

PRed in #562

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we could just change L111 to pass in ref.Kind and ignore the kind but it's busy work with that PR :)

@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented Oct 25, 2018

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 25, 2018
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [scothis,vaikas-google]

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

@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented Oct 25, 2018

@n3wscott care to remove the hold, or do you have remaining concerns?

@knative-prow-robot knative-prow-robot removed the lgtm Indicates that a PR is ready to be merged. label Oct 26, 2018
@scothis
Copy link
Copy Markdown
Contributor Author

scothis commented Oct 26, 2018

Updated to resolve new conflicts

@scothis
Copy link
Copy Markdown
Contributor Author

scothis commented Oct 26, 2018

Updated to resolve new conflicts (again)

@vaikas
Copy link
Copy Markdown
Contributor

vaikas commented Oct 26, 2018

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 26, 2018
@scothis
Copy link
Copy Markdown
Contributor Author

scothis commented Oct 26, 2018

/hold cancel

@n3wscott if you have further concerns I can follow up in a new PR

@knative-prow-robot knative-prow-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 26, 2018
@knative-prow-robot knative-prow-robot merged commit 642bfc1 into knative:master Oct 26, 2018
@scothis scothis deleted the provisioner-ref branch October 26, 2018 21:03
pierDipi pushed a commit to pierDipi/eventing that referenced this pull request Feb 27, 2024
Co-authored-by: Christoph Stäbler <cstabler@redhat.com>
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. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants