Skip to content

Adding Source type.#457

Merged
knative-prow-robot merged 13 commits into
knative:masterfrom
n3wscott:source_crd
Sep 25, 2018
Merged

Adding Source type.#457
knative-prow-robot merged 13 commits into
knative:masterfrom
n3wscott:source_crd

Conversation

@n3wscott
Copy link
Copy Markdown
Contributor

Fixes #445

Proposed Changes

  • Adding Source.eventing.knative.dev

Release Note

NONE

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 21, 2018
@knative-prow-robot knative-prow-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 21, 2018
@n3wscott n3wscott changed the title [WIP] Adding Source type. Adding Source type. Sep 21, 2018
@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 21, 2018
@n3wscott
Copy link
Copy Markdown
Contributor Author

/assign @grantr

/cc @vaikas-google

// - APIVersion
// - Name
// Currently Kind must be "Channel" and
// APIVersion must be "channels.knative.dev/v1alpha1"
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.

eventing.knative.dev/v1alpha1


// Valid from only contains the following fields:
// - Kind == 'Channel'
// - APIVersion == 'channels.knative.dev/v1alpha1'
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.

eventing.knative.dev/v1alpha1

Copy link
Copy Markdown
Contributor

@grantr grantr left a comment

Choose a reason for hiding this comment

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

Looks reasonable, but I'm surprised by the Channel spec field. It may be that I missed the discussion in which this field was decided on.

/cc @evankanderson

Comment thread pkg/apis/eventing/v1alpha1/source_types.go Outdated
Comment thread pkg/apis/eventing/v1alpha1/source_types.go Outdated
Comment thread pkg/apis/eventing/v1alpha1/source_types.go
// ObservedGeneration is the 'Generation' of the Source that
// was last reconciled by the controller.
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`
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.

Not really part of this PR, but I just noticed Subscription doesn't have an ObservedGeneration field. Should it?

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.

yes.

Comment thread pkg/apis/eventing/v1alpha1/source_types.go Outdated
Comment thread pkg/apis/eventing/v1alpha1/source_types.go Outdated
Comment thread pkg/apis/eventing/v1alpha1/source_validation.go
Comment thread pkg/apis/eventing/v1alpha1/source_validation.go Outdated
// Name, Kind, APIVersion
// If any other fields are set and is not the Zero value, returns an apis.FieldError
// with the fieldpaths for all those fields.
func checkDisallowedObjectReferenceFields(f corev1.ObjectReference) *apis.FieldError {
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.

How does this look with hardcoded fields instead of reflection? I think that might be easier to read, and the fields of ObjectReference are unlikely to change.

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.

I copied this from Ville, perhaps we can do a followup to clear this up if we need to

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.

subscribable_validation.go is a copy and rename of original subscription methods that are useful for sources

Copy link
Copy Markdown
Contributor

@grantr grantr left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

Thanks @n3wscott for this PR and helping resolve the confusion around interface contracts. 😁 I think there's further discussion to be had with the group about the specifics of those contracts but I'm happy to move this PR forward.

These suggested changes can go in a followup PR:

  • stop using reflection to validate ObjectReferences.
  • Move Subscribable and Channelable contract validations to Subscription controller reconcile since they'll require the object content to verify.

Comment thread pkg/apis/eventing/v1alpha1/source_validation.go Outdated
Comment thread pkg/apis/eventing/v1alpha1/source_types.go Outdated
@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 25, 2018
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: grantr, n3wscott

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:

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 25, 2018
@grantr
Copy link
Copy Markdown
Contributor

grantr commented Sep 25, 2018

/hold
(@n3wscott has more to get in)

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

grantr commented Sep 25, 2018

/lgtm
/hold cancel

@knative-prow-robot knative-prow-robot added lgtm Indicates that a PR is ready to be merged. and removed do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. labels Sep 25, 2018
@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on pkg/.
Say /test pull-knative-eventing-go-coverage to run the coverage report again

File Old Coverage New Coverage Delta
pkg/apis/eventing/v1alpha1/source_defaults.go Do not exist 100.0%
pkg/apis/eventing/v1alpha1/source_types.go Do not exist 100.0%
pkg/apis/eventing/v1alpha1/source_validation.go Do not exist 100.0%
pkg/apis/eventing/v1alpha1/subscribable_channelable_validation.go Do not exist 93.8%

@knative-prow-robot knative-prow-robot merged commit 1579b12 into knative:master Sep 25, 2018
// +optional
ObservedGeneration int64 `json:"observedGeneration,omitempty"`

// Source might be Subscribable. This points to the Channelable object.
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.

might? I think it must be Subscribable, how else would we get events from it? Is this CRD the "factory" for say, creating K8S events for consumption by the system, or is an instance one that I could create a Subscription.Spec.From to point to?

matzew added a commit to matzew/eventing that referenced this pull request Mar 2, 2020
Leo6Leo pushed a commit to Leo6Leo/eventing that referenced this pull request Jan 17, 2024
[release-v1.12 ] Trusted CA bundle CM work
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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants