Skip to content

Commit

Permalink
Update description for sink flag
Browse files Browse the repository at this point in the history
 - Add examples for broker, service and URI
 - Add note about default prefix and service alias
  • Loading branch information
navidshaikh committed Jun 19, 2020
1 parent 887d367 commit a98d22a
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/cmd/kn_source_apiserver_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kn source apiserver create NAME --resource RESOURCE --sink SINK
--resource stringArray Specification for which events to listen, in the format Kind:APIVersion:LabelSelector, e.g. "Event:v1:key=value".
"LabelSelector" is a list of comma separated key value pairs. "LabelSelector" can be omitted, e.g. "Event:v1".
--service-account string Name of the service account to use to run this source
-s, --sink string Addressable sink for events
-s, --sink string Addressable sink for events. You can specify broker, service or URI. Examples: '--sink broker:nest' for 'nest' broker, '--sink https://event.receiver.uri' for an URI (identified by 'http' or 'https'), '--sink service:receiver' for 'receiver' knative service, you can also use prefix alias 'svc' for 'service'. If do not specify a prefix, it is considered as knative service, i.e. '--sink receiver' is same as '--sink svc:receiver'.
```

### Options inherited from parent commands
Expand Down
2 changes: 1 addition & 1 deletion docs/cmd/kn_source_apiserver_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ kn source apiserver update NAME
--resource stringArray Specification for which events to listen, in the format Kind:APIVersion:LabelSelector, e.g. "Event:v1:key=value".
"LabelSelector" is a list of comma separated key value pairs. "LabelSelector" can be omitted, e.g. "Event:v1".
--service-account string Name of the service account to use to run this source
-s, --sink string Addressable sink for events
-s, --sink string Addressable sink for events. You can specify broker, service or URI. Examples: '--sink broker:nest' for 'nest' broker, '--sink https://event.receiver.uri' for an URI (identified by 'http' or 'https'), '--sink service:receiver' for 'receiver' knative service, you can also use prefix alias 'svc' for 'service'. If do not specify a prefix, it is considered as knative service, i.e. '--sink receiver' is same as '--sink svc:receiver'.
```

### Options inherited from parent commands
Expand Down
2 changes: 1 addition & 1 deletion docs/cmd/kn_source_binding_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ kn source binding create NAME --subject SUBJECT --sink SINK
--ce-override stringArray Cloud Event overrides to apply before sending event to sink. Example: '--ce-override key=value' You may be provide this flag multiple times. To unset, append "-" to the key (e.g. --ce-override key-).
-h, --help help for create
-n, --namespace string Specify the namespace to operate in.
-s, --sink string Addressable sink for events
-s, --sink string Addressable sink for events. You can specify broker, service or URI. Examples: '--sink broker:nest' for 'nest' broker, '--sink https://event.receiver.uri' for an URI (identified by 'http' or 'https'), '--sink service:receiver' for 'receiver' knative service, you can also use prefix alias 'svc' for 'service'. If do not specify a prefix, it is considered as knative service, i.e. '--sink receiver' is same as '--sink svc:receiver'.
--subject string Subject which emits cloud events. This argument takes format kind:apiVersion:name for named resources or kind:apiVersion:labelKey1=value1,labelKey2=value2 for matching via a label selector
```

Expand Down
2 changes: 1 addition & 1 deletion docs/cmd/kn_source_binding_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ kn source binding update NAME
--ce-override stringArray Cloud Event overrides to apply before sending event to sink. Example: '--ce-override key=value' You may be provide this flag multiple times. To unset, append "-" to the key (e.g. --ce-override key-).
-h, --help help for update
-n, --namespace string Specify the namespace to operate in.
-s, --sink string Addressable sink for events
-s, --sink string Addressable sink for events. You can specify broker, service or URI. Examples: '--sink broker:nest' for 'nest' broker, '--sink https://event.receiver.uri' for an URI (identified by 'http' or 'https'), '--sink service:receiver' for 'receiver' knative service, you can also use prefix alias 'svc' for 'service'. If do not specify a prefix, it is considered as knative service, i.e. '--sink receiver' is same as '--sink svc:receiver'.
--subject string Subject which emits cloud events. This argument takes format kind:apiVersion:name for named resources or kind:apiVersion:labelKey1=value1,labelKey2=value2 for matching via a label selector
```

Expand Down
2 changes: 1 addition & 1 deletion docs/cmd/kn_source_ping_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ kn source ping create NAME
-h, --help help for create
-n, --namespace string Specify the namespace to operate in.
--schedule string Optional schedule specification in crontab format (e.g. '*/2 * * * *' for every two minutes. By default fire every minute.
-s, --sink string Addressable sink for events
-s, --sink string Addressable sink for events. You can specify broker, service or URI. Examples: '--sink broker:nest' for 'nest' broker, '--sink https://event.receiver.uri' for an URI (identified by 'http' or 'https'), '--sink service:receiver' for 'receiver' knative service, you can also use prefix alias 'svc' for 'service'. If do not specify a prefix, it is considered as knative service, i.e. '--sink receiver' is same as '--sink svc:receiver'.
```

### Options inherited from parent commands
Expand Down
2 changes: 1 addition & 1 deletion docs/cmd/kn_source_ping_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ kn source ping update NAME
-h, --help help for update
-n, --namespace string Specify the namespace to operate in.
--schedule string Optional schedule specification in crontab format (e.g. '*/2 * * * *' for every two minutes. By default fire every minute.
-s, --sink string Addressable sink for events
-s, --sink string Addressable sink for events. You can specify broker, service or URI. Examples: '--sink broker:nest' for 'nest' broker, '--sink https://event.receiver.uri' for an URI (identified by 'http' or 'https'), '--sink service:receiver' for 'receiver' knative service, you can also use prefix alias 'svc' for 'service'. If do not specify a prefix, it is considered as knative service, i.e. '--sink receiver' is same as '--sink svc:receiver'.
```

### Options inherited from parent commands
Expand Down
2 changes: 1 addition & 1 deletion docs/cmd/kn_trigger_create.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ kn trigger create NAME --sink SINK
-h, --help help for create
--inject-broker Create new broker with name default through common annotation
-n, --namespace string Specify the namespace to operate in.
-s, --sink string Addressable sink for events
-s, --sink string Addressable sink for events. You can specify broker, service or URI. Examples: '--sink broker:nest' for 'nest' broker, '--sink https://event.receiver.uri' for an URI (identified by 'http' or 'https'), '--sink service:receiver' for 'receiver' knative service, you can also use prefix alias 'svc' for 'service'. If do not specify a prefix, it is considered as knative service, i.e. '--sink receiver' is same as '--sink svc:receiver'.
```

### Options inherited from parent commands
Expand Down
2 changes: 1 addition & 1 deletion docs/cmd/kn_trigger_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ kn trigger update NAME
-h, --help help for update
--inject-broker Create new broker with name default through common annotation
-n, --namespace string Specify the namespace to operate in.
-s, --sink string Addressable sink for events
-s, --sink string Addressable sink for events. You can specify broker, service or URI. Examples: '--sink broker:nest' for 'nest' broker, '--sink https://event.receiver.uri' for an URI (identified by 'http' or 'https'), '--sink service:receiver' for 'receiver' knative service, you can also use prefix alias 'svc' for 'service'. If do not specify a prefix, it is considered as knative service, i.e. '--sink receiver' is same as '--sink svc:receiver'.
```

### Options inherited from parent commands
Expand Down
13 changes: 12 additions & 1 deletion pkg/kn/commands/flags/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,18 @@ type SinkFlags struct {
}

func (i *SinkFlags) Add(cmd *cobra.Command) {
cmd.Flags().StringVarP(&i.sink, "sink", "s", "", "Addressable sink for events")
cmd.Flags().StringVarP(&i.sink,
"sink",
"s",
"",
"Addressable sink for events. "+
"You can specify broker, service or URI. "+
"Examples: '--sink broker:nest' for 'nest' broker, "+
"'--sink https://event.receiver.uri' for an URI (identified by 'http' or 'https'), "+
"'--sink service:receiver' for 'receiver' knative service, "+
"you can also use prefix alias 'svc' for 'service'. "+
"If do not specify a prefix, it is considered as knative service, "+
"i.e. '--sink receiver' is same as '--sink svc:receiver'.")

for _, p := range config.GlobalConfig.SinkMappings() {
//user configration might override the default configuration
Expand Down

0 comments on commit a98d22a

Please sign in to comment.