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

Align GVK format accepted by --channel flag #1871

Open
dsimansk opened this issue Sep 25, 2023 · 9 comments
Open

Align GVK format accepted by --channel flag #1871

dsimansk opened this issue Sep 25, 2023 · 9 comments
Assignees
Labels
good first issue Denotes an issue ready for a new contributor. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Milestone

Comments

@dsimansk
Copy link
Contributor

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 dsimansk added the kind/bug Categorizes issue or PR as related to a bug. label Sep 25, 2023
@knative-prow knative-prow bot added good first issue Denotes an issue ready for a new contributor. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Sep 25, 2023
@dsimansk dsimansk added this to the Knative 1.12 milestone Sep 25, 2023
@xiangpingjiang
Copy link
Contributor

/assign

@xiangpingjiang
Copy link
Contributor

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

@dsimansk
Copy link
Contributor Author

dsimansk commented Oct 9, 2023

@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
Copy link
Contributor

rhuss commented Dec 12, 2023

@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
Copy link
Contributor

xiangpingjiang commented Dec 12, 2023

@rhuss
No problem. I unassigned myself

@xiangpingjiang xiangpingjiang removed their assignment Dec 12, 2023
@TheRealSibasishBehera
Copy link

/assign

@mabulgu
Copy link

mabulgu commented May 21, 2024

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

@rhuss
Copy link
Contributor

rhuss commented May 21, 2024

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
Copy link

mabulgu commented May 21, 2024

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor. kind/bug Categorizes issue or PR as related to a bug. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

No branches or pull requests

5 participants