mirror of https://github.com/knative/client.git
Corrected version for kn create kafka channel (#1886)
* Corrected version for kn create kafka channel * Correct message * Fix missing import --------- Co-authored-by: David Simansky <dsimansk@redhat.com>
This commit is contained in:
parent
cef926d3b6
commit
5b33d701e8
|
|
@ -19,7 +19,7 @@ kn channel create NAME
|
|||
kn channel create imc1 --type messaging.knative.dev:v1:InMemoryChannel
|
||||
|
||||
# Create a channel 'k1' of type KafkaChannel
|
||||
kn channel create k1 --type messaging.knative.dev:v1alpha1:KafkaChannel
|
||||
kn channel create k1 --type messaging.knative.dev:v1beta1:KafkaChannel
|
||||
```
|
||||
|
||||
### Options
|
||||
|
|
@ -27,7 +27,7 @@ kn channel create NAME
|
|||
```
|
||||
-h, --help help for create
|
||||
-n, --namespace string Specify the namespace to operate in.
|
||||
--type string Override channel type to create, in the format '--type Group:Version:Kind'. If flag is not specified, it uses default messaging layer settings for channel type, cluster wide or specific namespace. You can configure aliases for channel types in kn config and refer the aliases with this flag. You can also refer inbuilt channel type InMemoryChannel using an alias 'imc' like '--type imc'. Examples: '--type messaging.knative.dev:v1alpha1:KafkaChannel' for specifying explicit Group:Version:Kind.
|
||||
--type string Override channel type to create, in the format '--type Group:Version:Kind'. If flag is not specified, it uses default messaging layer settings for channel type, cluster wide or specific namespace. You can configure aliases for channel types in kn config and refer the aliases with this flag. You can also refer inbuilt channel type InMemoryChannel using an alias 'imc' like '--type imc'. Examples: '--type messaging.knative.dev:v1beta1:KafkaChannel' for specifying explicit Group:Version:Kind.
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
|
|
|||
|
|
@ -14,13 +14,13 @@ kn subscription create NAME
|
|||
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
|
||||
kn subscription create sub1 --channel messaging.knative.dev:v1beta1: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').
|
||||
--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:v1beta1: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, 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.
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ func NewChannelCreateCommand(p *commands.KnParams) *cobra.Command {
|
|||
kn channel create imc1 --type messaging.knative.dev:v1:InMemoryChannel
|
||||
|
||||
# Create a channel 'k1' of type KafkaChannel
|
||||
kn channel create k1 --type messaging.knative.dev:v1alpha1:KafkaChannel`,
|
||||
kn channel create k1 --type messaging.knative.dev:v1beta1:KafkaChannel`,
|
||||
|
||||
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
||||
if len(args) != 1 {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ func NewSubscriptionCreateCommand(p *commands.KnParams) *cobra.Command {
|
|||
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`,
|
||||
kn subscription create sub1 --channel messaging.knative.dev:v1beta1:KafkaChannel:k1 --sink mirror --sink-reply broker:nest --sink-dead-letter bucket`,
|
||||
|
||||
RunE: func(cmd *cobra.Command, args []string) (err error) {
|
||||
if len(args) != 1 {
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ func (i *ChannelTypeFlags) Add(f *pflag.FlagSet) {
|
|||
"If flag is not specified, it uses default messaging layer settings for channel type, cluster wide or specific namespace. "+
|
||||
"You can configure aliases for channel types in kn config and refer the aliases with this flag. "+
|
||||
"You can also refer inbuilt channel type InMemoryChannel using an alias 'imc' like '--type imc'. "+
|
||||
"Examples: '--type messaging.knative.dev:v1alpha1:KafkaChannel' for specifying explicit Group:Version:Kind.")
|
||||
"Examples: '--type messaging.knative.dev:v1beta1:KafkaChannel' for specifying explicit Group:Version:Kind.")
|
||||
|
||||
for _, p := range config.GlobalConfig.ChannelTypeMappings() {
|
||||
//user configuration might override the default configuration
|
||||
|
|
@ -94,7 +94,7 @@ func (i *ChannelRef) Add(f *pflag.FlagSet) {
|
|||
"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').")
|
||||
"with Group:Version:Kind:Name (e.g. 'messaging.knative.dev:v1beta1:KafkaChannel:mychannel').")
|
||||
}
|
||||
|
||||
// Parse parses the CLI value for channel ref flag and populates object reference or return error
|
||||
|
|
|
|||
Loading…
Reference in New Issue