Skip to content
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

Meta Channel doesn't conform the spec's CRD spec.subscribers requirement #3051

Closed
aliok opened this issue Apr 27, 2020 · 15 comments · Fixed by #3088
Closed

Meta Channel doesn't conform the spec's CRD spec.subscribers requirement #3051

aliok opened this issue Apr 27, 2020 · 15 comments · Fixed by #3088
Assignees
Labels
area/channels kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Milestone

Comments

@aliok
Copy link
Member

aliok commented Apr 27, 2020

Describe the bug
As noted in #3050 (comment), Channel doesn't doesn't allow subscribers in the spec.

Spec says this:

Spec Requirements
v1alpha1 Spec: each channel CRD MUST contain an array of subscribers: spec.subscribable.subscribers
v1beta1 Spec: each channel CRD MUST contain an array of subscribers: spec.subscribers

When a channel.messaging.knative.dev is created, by default Knative creates an InMemoryChannel. When we create a subscription against that Channel, InMemoryChannel will have the subscribers in the status, but it is not propagated to channel.messaging.knative.dev. Other fields like status.address are propagated fine.

Expected behavior
I should be able to create a channel.messaging.knative.dev with spec.subscribable.subscribers and #3050 should pass.

To Reproduce

cat <<EOS |kubectl apply -f -
---
apiVersion: messaging.knative.dev/v1alpha1
kind: Channel
metadata:
  name: foo
spec:
  subscribable:
    subscribers:
    - UID: "1234"
      ReplyUri: "foo.bar"
EOS

ends up in

Error from server (BadRequest): error when creating "channel_v1alpha1.yaml": admission webhook "validation.webhook.eventing.knative.dev" denied the request: validation failed: must not set the field(s): spec.subscribable.subscribers

Knative release version
0.14

Additional context
#3050

@aliok aliok added the kind/bug Categorizes issue or PR as related to a bug. label Apr 27, 2020
@grantr grantr added area/channels priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Apr 27, 2020
@grantr grantr added this to the v0.15.0 milestone Apr 27, 2020
@vaikas
Copy link
Contributor

vaikas commented Apr 29, 2020

So, not allowing the setting of subscribers is definitely intentional. Without this it's impossible to have a source of truth that's reliable. If we allow modifications to both channel as well as the backing channel, hilarity will ensue in trying to understand what the actual intent is.

Not propagating the status seems like a bug as they should be propagated to the Channel (from the backing channel, one way sync only so there's no problem like we have with two sources of modifiable truth).

I'd suggest we tackle the documentation for the Channel either as "non-conformant" Channel or talk about more in the context of a convenience factory method.
@grantr
@lionelvillard

@aliok aliok changed the title Meta Channel doesn't conform the spec's CRD spec.status.subscribers requirement Meta Channel doesn't conform the spec's CRD spec.subscribers requirement Apr 30, 2020
@aliok
Copy link
Member Author

aliok commented Apr 30, 2020

So, for this issue, is it enough to change the spec statement

each channel CRD MUST contain an array of subscribers: spec.subscribers

to

other than channels.messaging.knative.dev, each channel CRD MUST contain an array of subscribers: spec.subscribers

?

@matzew
Copy link
Member

matzew commented Apr 30, 2020

Right, setting the subscribers is not for the spec, I added a comment here: #3050 (comment)

@matzew
Copy link
Member

matzew commented Apr 30, 2020

I'd suggest we tackle the documentation for the Channel either as "non-conformant" Channel or talk about more in the context of a convenience factory method.

@vaikas I think I would lean towards the later ?

@vaikas
Copy link
Contributor

vaikas commented Apr 30, 2020

That was my knee jerk reaction as well.

@lberk
Copy link
Member

lberk commented Apr 30, 2020

ok I'll try and tackle this as part of reviewing's @aliok's #3016
/unassign @aliok
/assign @lberk

@aliok
Copy link
Member Author

aliok commented May 8, 2020

/reopen

There's somethings mixed here. The PR #3088 is great (thanks @lberk ). It fixes #3037 and not this issue.

Reopening this and closing that one.

The tickets were named very similar.

@knative-prow-robot
Copy link
Contributor

@aliok: Reopened this issue.

In response to this:

/reopen

There's somethings mixed here. The PR #3088 is great (thanks @lberk ). It fixes #3037 and not this issue.

Reopening this and closing that one.

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.

@lberk
Copy link
Member

lberk commented May 8, 2020

@aliok As @vaikas mentioned in his comment:

So, not allowing the setting of subscribers is definitely intentional. Without this it's impossible to have a source of truth that's reliable. If we allow modifications to both channel as well as the backing channel, hilarity will ensue in trying to understand what the actual intent is.

That's why we adjusted the channel to properly reflect the subscribers status in the 'meta' channel. As stated, it is by design that we do not allow setting the subscriber field directly, if we did, we'd end up in a reconciler war between the backingChannel and the Channel itself.

If you still feel this issue is keeping open, then we'd need to discuss actually amending the spec for the Channel as specifically non-conformant.

@matzew
Copy link
Member

matzew commented May 8, 2020

discuss actually amending the spec for the Channel as specifically non-conformant.

not sure if we need to be that extreme ;-)

but how about saying, or "specifying" that the abstract channel is not supporting this, b/c it is handled by the "backing implementation(s)" ?

@lberk thoughts?

@aliok
Copy link
Member Author

aliok commented May 8, 2020

That's why we adjusted the channel to properly reflect the subscribers status in the 'meta' channel. As stated, it is by design that we do not allow setting the subscriber field directly, if we did, we'd end up in a reconciler war between the backingChannel and the Channel itself.

That's #3037

If you still feel this issue is keeping open, then we'd need to discuss actually amending the spec for the Channel as specifically non-conformant.

Either we keep this open and change the spec and close this OR we close this create a new ticket for spec change

@lberk
Copy link
Member

lberk commented May 8, 2020

I'm open to whatever the colour of the bikeshed you'd prefer in terms of phrasing it, but yes, the point being if we'd like to further address the issue (which I assume so because it was reopened), then we need to tackle in the spec

@lberk
Copy link
Member

lberk commented May 8, 2020

Either we keep this open and change the spec and close this OR we close this create a new ticket for spec change

no need for more issues & extra churn, lets just open a PR and reference this issue

@aliok
Copy link
Member Author

aliok commented May 15, 2020

/close

Fixed by #3132

@knative-prow-robot
Copy link
Contributor

@aliok: Closing this issue.

In response to this:

/close

Fixed by #3132

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/channels kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants