knative / client

Knative developer experience, docs, reference Knative CLI implementation
Apache License 2.0
344 stars 263 forks source link

Align GVK format accepted by `--channel` flag #1871

Open dsimansk opened 9 months ago

dsimansk commented 9 months ago

Bug report

Create a subscription

Usage:
  kn subscription create NAME [options]

Examples:

  # Create a subscription 'sub0' from InMemoryChannel 'pipe0' to a subscriber ksvc 'receiver'
  kn subscription create sub0 --channel imcv1beta1:pipe0 --sink ksvc:receiver

  # Create a subscription 'sub1' from KafkaChannel 'k1' to ksvc 'mirror', reply to a broker 'nest' and DeadLetterSink to a ksvc 'bucket'
  kn subscription create sub1 --channel messaging.knative.dev:v1alpha1:KafkaChannel:k1 --sink mirror --sink-reply broker:nest --sink-dead-letter bucket

Options:
      --channel string            Specify the channel to subscribe to. For the default channel, just use the name (e.g. 'mychannel'). A mapped channel type like 'imc' can be used as a prefix (e.g. 'imc:mychannel'). Finally you can specify the full coordinates to the referenced
                                  channel with Group:Version:Kind:Name (e.g. 'messaging.knative.dev:v1alpha1:KafkaChannel:mychannel').
  -n, --namespace string          Specify the namespace to operate in.
  -s, --sink string               Addressable sink for events. You can specify a broker, channel, Knative service or URI. Examples: '--sink broker:nest' for a broker 'nest', '--sink channel:pipe' for a channel 'pipe', '--sink ksvc:mysvc:mynamespace' for a Knative service 'mysvc' in
                                  another namespace 'mynamespace', '--sink https://event.receiver.uri' for an HTTP URI, '--sink ksvc:receiver' or simply '--sink receiver' for a Knative service 'receiver' in the current namespace. '--sink special.eventing.dev/v1alpha1/channels:pipe'
                                  for GroupVersionResource of v1alpha1 'pipe'. If a prefix is not provided, it is considered as a Knative service in the current namespace.

We should consider refactoring --channel flag on kn subscription create to be aligned within the same GVK format as --sink. There's common implementation for parsing it already, but for some reason it isn't used in case of Subscriptions.

Expected behavior

The --channel flag accepts the same GVK format as --sink and other similar option flags.

/kind bug /kind good-first-issue /kind cleanup

xiangpingjiang commented 9 months ago

/assign

xiangpingjiang commented 9 months ago

@dsimansk
hello David, the expected format is like --channel channel:pipe and --channel special.eventing.dev/v1alpha1/channels:pipe ?

dsimansk commented 9 months ago

@dsimansk hello David, the expected format is like --channel channel:pipe and --channel special.eventing.dev/v1alpha1/channels:pipe ?

Yes, the same as for --sink flag.

rhuss commented 7 months ago

@xiangpingjiang are you still working on the issue ? If not, no problem, but we would then assign it to somebody else who is also interested. Please let me know until tomorrow, otherwise, I would unassign you if this is ok

xiangpingjiang commented 7 months ago

@rhuss No problem. I unassigned myself

TheRealSibasishBehera commented 6 months ago

/assign

mabulgu commented 1 month ago

@rhuss is this sth still unassigned (and undone)? If so I want to take a look at this.

rhuss commented 1 month ago

AFAIK it's still an open issue, hapyy to support you if you would like to give it a try! @dsimansk can also help you here.

mabulgu commented 1 month ago

/assign

EraKin575 commented 3 weeks ago

Hi,@rhuss! I don't think @mabulgu is currently working on this issue.Mind if I take this up? :)

dsimansk commented 3 weeks ago

@EraKin575 please go ahead.

mabulgu commented 2 weeks ago

I don't think @mabulgu is currently working on this issue

@EraKin575 what made you think that I am not working on this issue? this was still on my list and looking at the cadence, 1 month seems normal.

Pls ping the assignee first (in this case me) as these kinda issues are already long waiting issues (opened on sept 2023). In my case, it was only 1 month so you were wrong about my not being active on this issue. I was on a PTO and recently saw your message here from 4 days ago.

Thanks for your collaboration. Next time hoping for a better communication;)