Skip to content

Messaging v1beta1 Types#2373

Merged
knative-prow-robot merged 14 commits into
knative:masterfrom
vaikas:messaging-v1beta1
Jan 21, 2020
Merged

Messaging v1beta1 Types#2373
knative-prow-robot merged 14 commits into
knative:masterfrom
vaikas:messaging-v1beta1

Conversation

@vaikas
Copy link
Copy Markdown
Contributor

@vaikas vaikas commented Jan 10, 2020

Addresses #1869

Proposed Changes

  • Add v1beta1.[subscription,channel,inmemorychannel]
  • Add corresponding duckv1beta1 types

Release Note

NONE (missing reconcilers, etc. just the types).

@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 Jan 10, 2020
@googlebot googlebot added the cla: yes Indicates the PR's author has signed the CLA. label Jan 10, 2020
@knative-prow-robot knative-prow-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jan 10, 2020
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vaikas

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 Jan 10, 2020
@knative-prow-robot knative-prow-robot added the area/test-and-release Test infrastructure, tests or release label Jan 10, 2020
Comment thread pkg/apis/duck/v1beta1/channelable_types.go Outdated
Comment thread pkg/apis/duck/v1beta1/channelable_types.go Outdated
Comment thread pkg/apis/duck/v1beta1/subscribable_types.go Outdated
Comment thread pkg/apis/duck/v1beta1/subscribable_types.go
Comment thread pkg/apis/duck/v1beta1/subscribable_types.go Outdated
Comment thread pkg/apis/messaging/v1beta1/subscription_types.go Outdated
ReplyURI *apis.URL `json:"replyURI,omitempty"`

// ReplyURI is the fully resolved URI for the spec.delivery.deadLetterSink.
DeadLetterSinkURI *apis.URL `json:"deadLetterSinkURI,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.

the correct json should be deadLetterSinkUri`

Why is the channel error and this deadLetter?

Comment thread pkg/apis/duck/v1beta1/subscribable_types.go Outdated
Comment thread pkg/apis/duck/v1beta1/subscribable_types.go Outdated
Comment thread pkg/apis/duck/v1beta1/subscribable_types.go Outdated
@vaikas
Copy link
Copy Markdown
Contributor Author

vaikas commented Jan 10, 2020

Thanks much! So far I think I addressed all the items that I could that I think we can do without some further input. Here's what I see the big ticket items that need resolving. Pulling them here
so they don't get lost in the comments:

  1. Can Subscription specify DLC
  2. Should DeliverySpec either be:
  • Moved to v1beta1 ✅
  1. Change Subscription.Status.PhysicalSubscription to ResolvedSubscription
  • AND: rename json field: physicalSubscription -> resolved
  1. What does (ties in with 1 above) Status expose.

@vaikas vaikas force-pushed the messaging-v1beta1 branch 2 times, most recently from f78c785 to 58f704c Compare January 13, 2020 20:12
@vaikas
Copy link
Copy Markdown
Contributor Author

vaikas commented Jan 13, 2020

/test pull-knative-eventing-integration-tests

@vaikas vaikas force-pushed the messaging-v1beta1 branch from 9bec93a to fbc0e24 Compare January 15, 2020 02:11
Comment thread pkg/apis/duck/v1beta1/subscribable_types.go
Comment thread pkg/apis/duck/v1beta1/subscribable_types.go Outdated
Comment thread pkg/apis/duck/v1beta1/subscribable_types.go
Comment thread pkg/apis/messaging/v1beta1/subscription_types.go
Comment thread pkg/apis/duck/v1beta1/delivery_types.go
// DeadLetterChannel is the reference to the native, platform specific channel
// where failed events are sent to.
// +optional
DeadLetterChannel *corev1.ObjectReference `json:"deadLetterChannel,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.

maybe the type should be api.URL.

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.

In the status, it should be a reference to a Channel (well, really, Subscribable). That way you can Subscribe to the events that have failed. Make sense?

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.

I had the same thought until I realized that this really is a ref to a channel that the owning channel created. I am +1 on DeadLetterChannel

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.

Maybe this object also needs a deadlettersinkuri? If the resource has a delivery spec in the spec there is currently no place to show a resolved delivery deadleattersink.

Or there are two kinds of status objects, one where the channel makes you a deadletter channel, and ones that use the resolved deadletter destination

Comment thread pkg/apis/duck/v1beta1/subscribable_types.go Outdated
Comment thread pkg/apis/duck/v1beta1/subscribable_types.go Outdated
Comment thread pkg/apis/duck/v1beta1/channelable_types.go
// Channelable is a skeleton type wrapping Subscribable and Addressable in the manner we expect resource writers
// defining compatible resources to embed it. We will typically use this type to deserialize
// Channelable ObjectReferences and access their subscription and address data. This is not a real resource.
type Channelable struct {
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.

If Delivery moved into Subscribable, then we can drop Channelable all together and a channel becomes

Addressable + Subscribable.

What do you think?

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.

make sense to me. Big change though....

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.

Besides removing one duck type (which I kind of think adds clarity), are there other benefits to removing it? I think being able to operate on a Channel ducktype as a single object in the consuming code base is kind of nice (instead of operating on Addressable / Subscribable) separately.
Not against it, just not sure what the concrete benefits of it are.

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.

sorry, I meant that actually having the Channelable as a separate duck type adds clarity, not removing it. So, what are the benefits for removing it?

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.

Simplify the number of things, channelable does not add anything new, just the union of two other ducks

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.

But the code using it now needs to set up two watches if it cares about channels (one for addressable and one for subscribable) and extra serializations / etc.? Am I just confused here? Seems like it has downsides and I'm not seeing the upside of removing the duck.

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.

Given the discussion above about Delivery NOT moving to Subscribable (since it needs to be available per Subscription) but moving to SubscriberSpec and the fact that there's also a DeadLetterChannel in the Channel, I don't see this happening. But perhaps I'm missing something here? So it's not only Subscribable, Addressable but also has DeadLetterChannel in the status.

Comment thread pkg/apis/messaging/v1beta1/channel_types.go Outdated
Comment thread pkg/apis/messaging/v1beta1/channel_types.go Outdated
Comment thread pkg/apis/messaging/v1beta1/channel_types.go Outdated
@vaikas vaikas force-pushed the messaging-v1beta1 branch from 40d0d25 to 589f5f5 Compare January 18, 2020 04:01
@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on the affected files.
Say /test pull-knative-eventing-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/duck/v1beta1/channelable_types.go Do not exist 87.5%
pkg/apis/duck/v1beta1/subscribable_types.go Do not exist 100.0%
pkg/apis/messaging/v1beta1/channel_defaults.go Do not exist 100.0%
pkg/apis/messaging/v1beta1/channel_lifecycle.go Do not exist 83.3%
pkg/apis/messaging/v1beta1/channel_validation.go Do not exist 96.2%
pkg/apis/messaging/v1beta1/in_memory_channel_defaults.go Do not exist 0.0%
pkg/apis/messaging/v1beta1/in_memory_channel_lifecycle.go Do not exist 75.0%
pkg/apis/messaging/v1beta1/in_memory_channel_validation.go Do not exist 100.0%
pkg/apis/messaging/v1beta1/register.go Do not exist 0.0%
pkg/apis/messaging/v1beta1/subscribable_channelable_validation.go Do not exist 100.0%
pkg/apis/messaging/v1beta1/subscription_defaults.go Do not exist 100.0%
pkg/apis/messaging/v1beta1/subscription_lifecycle.go Do not exist 61.5%
pkg/apis/messaging/v1beta1/subscription_types.go Do not exist 50.0%
pkg/apis/messaging/v1beta1/subscription_validation.go Do not exist 93.3%

@knative-prow-robot
Copy link
Copy Markdown
Contributor

knative-prow-robot commented Jan 18, 2020

@vaikas: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-knative-eventing-go-coverage 589f5f5 link /test pull-knative-eventing-go-coverage

Full PR test history. Your PR dashboard.

Details

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/test-infra repository. I understand the commands that are listed here.

@vaikas vaikas mentioned this pull request Jan 18, 2020
// SubscribableStatus is the part where SubscribableStatus object is
// configured as to be compatible with Subscribable contract.
Status SubscribableTypeStatus `json:"status"`
Status SubscribableStatus `json:"status"`
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.

I still want to question status. Is it really just a quick way to know spec.subscriber[x].generation == status.subscriber[x].generation?

If so, I think it should be removed.

If not, and it is the status of the subscriber, it should be removed because it is not the job of the channel to look up the subscribers.

If it is the status of the data plane result (like, we are getting 2xx's) I also think it should be renamed or rethought because if this is false, it is useless without a reason and message.

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 was thinking it would be that the subscription has been wired up. You asked for a subscription in the Spec, reconciler then goes and makes that, how would you know if something went wrong? But, I'm reading some of the more of the codes now.

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.

Then maybe you are pro-"add a reason and a message"?

status.subscriber[x].ready: false falls short of being useful info to act on.

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.

Ack. @n3wscott and I talked offline. So the spec.Array and status.Array has precedent in things like pod (container in spec -> containerstatuses). so using array in spec and array in status to match part is all good. I'll create a more targeted issue for possibly renaming / modifying the fields within the SubscriberStatus struct.

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 created this issue to track this in specific. As we move forward with the implementation of the controller and channels, etc. we will revisit this as part of that issue:
#2416

// GetListType implements apis.Listable
func (c *SubscribableType) GetListType() runtime.Object {
return &SubscribableTypeList{}
func (c *Subscribable) GetListType() runtime.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.

this reads so much better, nice work.

Comment thread pkg/apis/messaging/v1beta1/channel_types.go
Comment thread pkg/apis/messaging/v1beta1/in_memory_channel_validation.go
@vaikas vaikas changed the title WIP: Messaging v1beta1 Types Messaging v1beta1 Types Jan 21, 2020
@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 Jan 21, 2020
@n3wscott
Copy link
Copy Markdown
Contributor

/lgtm

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 21, 2020
@knative-prow-robot knative-prow-robot merged commit e4533ef into knative:master Jan 21, 2020
@vaikas vaikas deleted the messaging-v1beta1 branch January 21, 2020 23:51
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. area/test-and-release Test infrastructure, tests or release cla: yes Indicates the PR's author has signed the CLA. 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.

8 participants