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

kn trigger update --help information is incorrect #1813

Closed
paulyhedral opened this issue May 12, 2023 · 2 comments · Fixed by #1847
Closed

kn trigger update --help information is incorrect #1813

paulyhedral opened this issue May 12, 2023 · 2 comments · Fixed by #1847
Labels
good first issue Denotes an issue ready for a new contributor. kind/bug Categorizes issue or PR as related to a bug. triage/accepted Issues which should be fixed (post-triage)
Milestone

Comments

@paulyhedral
Copy link

Bug report

kn trigger update --help implies that updating the broker is possible, but when

kn trigger update trigger-name --broker broker-name

is executed, the following error is output:

Error: cannot update trigger 'example-trigger' because broker is immutable

Expected behavior

If the broker is immutable on a trigger, then the help information for update should not indicate that it is available as an option.

Steps to reproduce the problem

kn version

Version:      v1.10.0
Build Date:   2023-04-26 10:17:21
Git Revision: 46dbf661
Supported APIs:
* Serving
  - serving.knative.dev/v1 (knative-serving v1.10.0)
* Eventing
  - sources.knative.dev/v1 (knative-eventing v1.10.0)
  - eventing.knative.dev/v1 (knative-eventing v1.10.0)
$ kn trigger update --help
Update a trigger

Usage:
  kn trigger update NAME [options]

Examples:

  # Update the filter which key is 'type' to value 'knative.dev.bar' in a trigger 'mytrigger'
  kn trigger update mytrigger --filter type=knative.dev.bar

  # Remove the filter which key is 'type' from a trigger 'mytrigger'
  kn trigger update mytrigger --filter type-

  # Update the sink of a trigger 'mytrigger' to 'ksvc:new-service'
  kn trigger update mytrigger --sink ksvc:new-service


Options:
      --broker string      Name of the Broker which the trigger associates with. (default "default")
      --filter strings     Key-value pair for exact CloudEvent attribute matching against incoming events, e.g type=dev.knative.foo
  -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 URI with an
                           'http://' or 'https://' schema, '--sink ksvc:receiver' or simply '--sink receiver' for a Knative service 'receiver' in the current namespace. If a prefix is not provided, it
                           is considered as a Knative service in the current namespace. If referring to a Knative service in another namespace, 'ksvc:name:namespace' combination must be provided explicitly.

Use "kn options" for a list of global command-line options (applies to all commands).

$ kn trigger update example-trigger --broker eventing-book
Error: cannot update trigger 'example-trigger' because broker is immutable
Run 'kn --help' for usage

Knative (serving/eventing) version

v1.10.0

@paulyhedral paulyhedral added the kind/bug Categorizes issue or PR as related to a bug. label May 12, 2023
@rhuss
Copy link
Contributor

rhuss commented Jul 19, 2023

Thanks! This indeed a valid bug, there might have been some changes in the backend.

@rhuss rhuss added the good first issue Denotes an issue ready for a new contributor. label Jul 19, 2023
@dsimansk dsimansk added the triage/accepted Issues which should be fixed (post-triage) label Aug 10, 2023
@dsimansk dsimansk added this to the Knative 1.12 milestone Aug 10, 2023
@dsimansk
Copy link
Contributor

Thanks! This indeed a valid bug, there might have been some changes in the backend.

It seems Spec.Broker was always immutable field. We probably overlooked it. Thanks for the report!

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. triage/accepted Issues which should be fixed (post-triage)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants