client icon indicating copy to clipboard operation
client copied to clipboard

Align GVK format accepted by `--channel` flag

Open dsimansk opened this issue 2 years ago • 12 comments

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

dsimansk avatar Sep 25 '23 13:09 dsimansk

/assign

xiangpingjiang avatar Sep 25 '23 15:09 xiangpingjiang

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

xiangpingjiang avatar Oct 01 '23 08:10 xiangpingjiang

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

dsimansk avatar Oct 09 '23 12:10 dsimansk

@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

rhuss avatar Dec 12 '23 09:12 rhuss

@rhuss No problem. I unassigned myself

xiangpingjiang avatar Dec 12 '23 12:12 xiangpingjiang

/assign

TheRealSibasishBehera avatar Dec 22 '23 08:12 TheRealSibasishBehera

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

mabulgu avatar May 21 '24 11:05 mabulgu

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.

rhuss avatar May 21 '24 15:05 rhuss

/assign

mabulgu avatar May 21 '24 23:05 mabulgu

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

EraKin575 avatar Jun 17 '24 11:06 EraKin575

@EraKin575 please go ahead.

dsimansk avatar Jun 17 '24 11:06 dsimansk

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;)

mabulgu avatar Jun 21 '24 16:06 mabulgu

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Reopen the issue with /reopen. Mark the issue as fresh by adding the comment /remove-lifecycle stale.

github-actions[bot] avatar Sep 20 '24 01:09 github-actions[bot]