forked from knative/client
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Subscription CRUD (knative#1013)
* feat: Add subscription CRUD - Add kn subscription command group and CRUDL sub-commands - create/update uses following flag names for better alignment: - --sink for subscriber - --sink-reply for reply - --sink-dead-letter for dead-letter-sink - Add 'subscriptions' and 'sub' aliases - Introduce shared library `knative.dev/client/lib/printing` to print Sink object in describe output * Set default channel type messaging.knative.dev/v1beta1:Channel i.e. if no prefix is given to `--channel`, consider it of `Channel` type * Update e2e tests * Update channel flag description
- Loading branch information
1 parent
213a60a
commit c1ca5ab
Showing
41 changed files
with
2,109 additions
and
34 deletions.
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
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
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
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
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,35 @@ | ||
## kn subscription | ||
|
||
Manage event subscriptions | ||
|
||
### Synopsis | ||
|
||
Manage event subscriptions | ||
|
||
``` | ||
kn subscription COMMAND | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for subscription | ||
``` | ||
|
||
### 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 subscription create](kn_subscription_create.md) - Create a subscription | ||
* [kn subscription delete](kn_subscription_delete.md) - Delete a subscription | ||
* [kn subscription describe](kn_subscription_describe.md) - Show details of a subscription | ||
* [kn subscription list](kn_subscription_list.md) - List subscriptions | ||
* [kn subscription update](kn_subscription_update.md) - Update an event subscription | ||
|
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,46 @@ | ||
## kn subscription create | ||
|
||
Create a subscription | ||
|
||
### Synopsis | ||
|
||
Create a subscription | ||
|
||
``` | ||
kn subscription create NAME | ||
``` | ||
|
||
### 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'). | ||
-h, --help help for create | ||
-n, --namespace string Specify the namespace to operate in. | ||
-s, --sink string Addressable sink for events. You can specify a broker, Knative service or URI. Examples: '--sink broker:nest' for a broker 'nest', '--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'. If a prefix is not provided, it is considered as a Knative service. | ||
--sink-dead-letter string Addressable sink for events. You can specify a broker, Knative service or URI. Examples: '--sink-dead-letter broker:nest' for a broker 'nest', '--sink-dead-letter https://event.receiver.uri' for an URI with an 'http://' or 'https://' schema, '--sink-dead-letter ksvc:receiver' or simply '--sink-dead-letter receiver' for a Knative service 'receiver'. If a prefix is not provided, it is considered as a Knative service. | ||
--sink-reply string Addressable sink for events. You can specify a broker, Knative service or URI. Examples: '--sink-reply broker:nest' for a broker 'nest', '--sink-reply https://event.receiver.uri' for an URI with an 'http://' or 'https://' schema, '--sink-reply ksvc:receiver' or simply '--sink-reply receiver' for a Knative service 'receiver'. If a prefix is not provided, it is considered as a Knative service. | ||
``` | ||
|
||
### 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 subscription](kn_subscription.md) - Manage event subscriptions | ||
|
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,39 @@ | ||
## kn subscription delete | ||
|
||
Delete a subscription | ||
|
||
### Synopsis | ||
|
||
Delete a subscription | ||
|
||
``` | ||
kn subscription delete NAME | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
# Delete a subscription 'sub0' | ||
kn subscription delete sub0 | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for delete | ||
-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 subscription](kn_subscription.md) - Manage event subscriptions | ||
|
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 subscription describe | ||
|
||
Show details of a subscription | ||
|
||
### Synopsis | ||
|
||
Show details of a subscription | ||
|
||
``` | ||
kn subscription describe NAME | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
# Describe a subscription 'pipe' | ||
kn subscription describe pipe | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
--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 describe | ||
-n, --namespace string Specify the namespace to operate in. | ||
-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]. | ||
-v, --verbose More output. | ||
``` | ||
|
||
### 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 subscription](kn_subscription.md) - Manage event subscriptions | ||
|
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 subscription list | ||
|
||
List subscriptions | ||
|
||
### Synopsis | ||
|
||
List subscriptions | ||
|
||
``` | ||
kn subscription list | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
# List all subscriptions | ||
kn subscription list | ||
# List subscriptions in YAML format | ||
kn subscription list -o yaml | ||
``` | ||
|
||
### 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 subscription](kn_subscription.md) - Manage event subscriptions | ||
|
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,45 @@ | ||
## kn subscription update | ||
|
||
Update an event subscription | ||
|
||
### Synopsis | ||
|
||
Update an event subscription | ||
|
||
``` | ||
kn subscription update NAME | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
# Update a subscription 'sub0' with a subscriber ksvc 'receiver' | ||
kn subscription update sub0 --sink ksvc:receiver | ||
# Update a subscription 'sub1' with subscriber ksvc 'mirror', reply to a broker 'nest' and DeadLetterSink to a ksvc 'bucket' | ||
kn subscription update sub1 --sink mirror --sink-reply broker:nest --sink-dead-letter bucket | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for update | ||
-n, --namespace string Specify the namespace to operate in. | ||
-s, --sink string Addressable sink for events. You can specify a broker, Knative service or URI. Examples: '--sink broker:nest' for a broker 'nest', '--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'. If a prefix is not provided, it is considered as a Knative service. | ||
--sink-dead-letter string Addressable sink for events. You can specify a broker, Knative service or URI. Examples: '--sink-dead-letter broker:nest' for a broker 'nest', '--sink-dead-letter https://event.receiver.uri' for an URI with an 'http://' or 'https://' schema, '--sink-dead-letter ksvc:receiver' or simply '--sink-dead-letter receiver' for a Knative service 'receiver'. If a prefix is not provided, it is considered as a Knative service. | ||
--sink-reply string Addressable sink for events. You can specify a broker, Knative service or URI. Examples: '--sink-reply broker:nest' for a broker 'nest', '--sink-reply https://event.receiver.uri' for an URI with an 'http://' or 'https://' schema, '--sink-reply ksvc:receiver' or simply '--sink-reply receiver' for a Knative service 'receiver'. If a prefix is not provided, it is considered as a Knative service. | ||
``` | ||
|
||
### 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 subscription](kn_subscription.md) - Manage event subscriptions | ||
|
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.