-
Notifications
You must be signed in to change notification settings - Fork 263
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
Add broker create, delete and list cmds #894
Merged
Merged
Changes from 22 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
22e9274
Add broker create, delete and list cmds
dsimansk 91abb1c
fix: Fix copyright headers
dsimansk 54befac
fix: Fix linter warnings
dsimansk 629b73b
Update pkg/kn/commands/broker/create.go
dsimansk 10536f2
Update pkg/kn/commands/broker/delete.go
dsimansk db5a42a
Update pkg/kn/commands/broker/list.go
dsimansk 2997489
feat: Add broker describe command
dsimansk 0f8a96a
fix: Fix copyright header
dsimansk 784a912
fix: Fix linter issues
dsimansk 25ec5bd
fix: Fix broker describe test
dsimansk 4e70573
fix: Fix order of eventing cmds
dsimansk 9b2901a
chore: Add e2e tests
dsimansk d671e82
fix: Fix e2e tests annotation
dsimansk 2e0e657
fix: Reorder e2e tests methods
dsimansk e7b5261
feat: Add synchronous broker delete option
dsimansk 1df31dc
fix: Fix broker describe example
dsimansk feacf79
fix: Fix variable name
dsimansk a61ef4c
fix: Fix broker list example formatting
dsimansk 45abb53
fix: Fix eventing client func name
dsimansk 045175e
fix: Reflect changes from PR review suggestions
dsimansk 6f2d98c
fix: Fix formatting of cmd examples
dsimansk c24eba1
fix: Fix formatting of cmd examples & trailing spaces
dsimansk 90a0dec
fix: Polish eventing client docs
dsimansk db8f0fb
fix: Fix examples alignment
dsimansk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
## kn broker | ||
|
||
Manage message broker | ||
|
||
### Synopsis | ||
|
||
Manage message broker | ||
|
||
``` | ||
kn broker | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for broker | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string kn configuration file (default: ~/.config/kn/config.yaml) | ||
--kubeconfig string kubectl configuration file (default: ~/.kube/config) | ||
--log-http log http traffic | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [kn](kn.md) - kn manages Knative Serving and Eventing resources | ||
* [kn broker create](kn_broker_create.md) - Create a broker | ||
* [kn broker delete](kn_broker_delete.md) - Delete a broker | ||
* [kn broker describe](kn_broker_describe.md) - Describe broker | ||
* [kn broker list](kn_broker_list.md) - List brokers | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
## kn broker create | ||
|
||
Create a broker | ||
|
||
### Synopsis | ||
|
||
Create a broker | ||
|
||
``` | ||
kn broker create NAME | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
|
||
# Create a broker 'mybroker' in the current namespace | ||
kn broker create mybroker | ||
|
||
# Create a broker 'mybroker' in the 'myproject' namespace | ||
kn broker create mybroker --namespace myproject | ||
|
||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for create | ||
-n, --namespace string Specify the namespace to operate in. | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string kn configuration file (default: ~/.config/kn/config.yaml) | ||
--kubeconfig string kubectl configuration file (default: ~/.kube/config) | ||
--log-http log http traffic | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [kn broker](kn_broker.md) - Manage message broker | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
## kn broker delete | ||
|
||
Delete a broker | ||
|
||
### Synopsis | ||
|
||
Delete a broker | ||
|
||
``` | ||
kn broker delete NAME | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
|
||
# Delete a broker 'mybroker' in the current namespace | ||
kn broker create mybroker | ||
|
||
# Delete a broker 'mybroker' in the 'myproject' namespace | ||
kn broker create mybroker --namespace myproject | ||
|
||
``` | ||
|
||
### Options | ||
|
||
``` | ||
--async DEPRECATED: please use --no-wait instead. Do not wait for 'broker delete' operation to be completed. (default true) | ||
-h, --help help for delete | ||
-n, --namespace string Specify the namespace to operate in. | ||
--no-wait Do not wait for 'broker delete' operation to be completed. (default true) | ||
--wait Wait for 'broker delete' operation to be completed. | ||
--wait-timeout int Seconds to wait before giving up on waiting for broker to be deleted. (default 600) | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string kn configuration file (default: ~/.config/kn/config.yaml) | ||
--kubeconfig string kubectl configuration file (default: ~/.kube/config) | ||
--log-http log http traffic | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [kn broker](kn_broker.md) - Manage message broker | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
## kn broker describe | ||
|
||
Describe broker | ||
|
||
### Synopsis | ||
|
||
Describe broker | ||
|
||
``` | ||
kn broker describe NAME | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
|
||
# Describe broker 'mybroker' in the current namespace | ||
kn broker describe mybroker | ||
|
||
# Describe broker 'mybroker' in the 'myproject' namespace | ||
kn broker describe mybroker --namespace myproject | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for describe | ||
-n, --namespace string Specify the namespace to operate in. | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string kn configuration file (default: ~/.config/kn/config.yaml) | ||
--kubeconfig string kubectl configuration file (default: ~/.kube/config) | ||
--log-http log http traffic | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [kn broker](kn_broker.md) - Manage message broker | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
## kn broker list | ||
|
||
List brokers | ||
|
||
### Synopsis | ||
|
||
List brokers | ||
|
||
``` | ||
kn broker list | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
|
||
# List all brokers | ||
kn broker list | ||
|
||
# List all brokers in JSON output format | ||
kn broker list -o json | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-A, --all-namespaces If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace. | ||
--allow-missing-template-keys If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats. (default true) | ||
-h, --help help for list | ||
-n, --namespace string Specify the namespace to operate in. | ||
--no-headers When using the default output format, don't print headers (default: print headers). | ||
-o, --output string Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-file. | ||
--template string Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]. | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string kn configuration file (default: ~/.config/kn/config.yaml) | ||
--kubeconfig string kubectl configuration file (default: ~/.kube/config) | ||
--log-http log http traffic | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [kn broker](kn_broker.md) - Manage message broker | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there is a good default for a broker (named 'default') I wonder whether we can make the name optional for all broker commands.
That would help in creating a default broker like the injection would do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd go for requiring the name explicitly as arg for
create
. Keepingcreate
formula consistent with other resources.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've decided to keep
create
consistent with the rest of resource creation flow, but I've had those thoughts myself that "default" might be worth. However, we can consider "default" to be exclusive for annotation created broker, therefore keepingname
argument required here.