-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(source binding): Support for Sink Binding as source (#625)
* feature(source binding): Support for Sink Binding as source Sink bindings are managed like any other source. Sinks are specified as usual (with prefix and name), 'subjects' (the other end of the binding) is managed via a shortcut notation: * with name: `<kind>:<apiVersion>:<name>` * with label selector: `<kind>:<apiVersion>:key1=value1,key2=value2` With `--subject-namespace` and additional namespace can be provided (shoudl be possible for a sink, too but is not yet) The implementation already uses the new sink binding from the `sources.knative.dev` group and hence is a bit inconsistent to the still old usage kf `sources.eventing.knative.dev` for apiserver source and cronjob. However as we will move over to `sources.knative.dev` very soon (right after v0.12.0) release, this is was more appropriates. Still WIP, but eventually fixes #624 Task list: - [X] create - [] update - [] delete - [] describe - [] list * fix(source binding): Added missing commands Also, it looks like that knative eventing 0.12.0 is still on the old api group. So I need to move this code to use the legacyclient, too, for the sink binding and only switch over to the new client for 0.13.0 * feature(source binding): Added missing subcommands * update * delete * list * describe * fix(source binding): Removed --subject-namespace as this namespace cant b set. Tuned describe output a bit. * feat(source binding) add support for CeOverride * fix: Worked on review comments * fix: review comments * fix: names in binding client
- Loading branch information
Showing
60 changed files
with
3,090 additions
and
53 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## kn source binding | ||
|
||
Sink binding command group | ||
|
||
### Synopsis | ||
|
||
Sink binding command group | ||
|
||
``` | ||
kn source binding [flags] | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for binding | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string kn config file (default is $HOME/.kn/config.yaml) | ||
--kubeconfig string kubectl config file (default is $HOME/.kube/config) | ||
--log-http log http traffic | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [kn source](kn_source.md) - Event source command group | ||
* [kn source binding create](kn_source_binding_create.md) - Create a sink binding. | ||
* [kn source binding delete](kn_source_binding_delete.md) - Delete a sink binding. | ||
* [kn source binding describe](kn_source_binding_describe.md) - Describe a sink binding. | ||
* [kn source binding list](kn_source_binding_list.md) - List sink bindings. | ||
* [kn source binding update](kn_source_binding_update.md) - Update a sink binding. | ||
|
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 source binding create | ||
|
||
Create a sink binding. | ||
|
||
### Synopsis | ||
|
||
Create a sink binding. | ||
|
||
``` | ||
kn source binding create NAME --subject SCHEDULE --sink SINK --ce-override KEY=VALUE [flags] | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
# Create a sink binding which connects a deployment 'myapp' with a Knative service 'mysvc' | ||
kn source binding create my-binding --subject Deployemnt:apps/v1:myapp --sink svc:mysvc | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
--ce-override stringArray Cloud Event overrides to apply before sending event to sink in the format '--ce-override key=value'. --ce-override can be provide multiple times | ||
-h, --help help for create | ||
-n, --namespace string Specify the namespace to operate in. | ||
-s, --sink string Addressable sink for events | ||
--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 | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string kn config file (default is $HOME/.kn/config.yaml) | ||
--kubeconfig string kubectl config file (default is $HOME/.kube/config) | ||
--log-http log http traffic | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [kn source binding](kn_source_binding.md) - Sink binding command group | ||
|
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 source binding delete | ||
|
||
Delete a sink binding. | ||
|
||
### Synopsis | ||
|
||
Delete a sink binding. | ||
|
||
``` | ||
kn source binding delete NAME [flags] | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
# Delete a sink binding with name 'my-binding' | ||
kn source binding delete my-binding | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for delete | ||
-n, --namespace string Specify the namespace to operate in. | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string kn config file (default is $HOME/.kn/config.yaml) | ||
--kubeconfig string kubectl config file (default is $HOME/.kube/config) | ||
--log-http log http traffic | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [kn source binding](kn_source_binding.md) - Sink binding command group | ||
|
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,40 @@ | ||
## kn source binding describe | ||
|
||
Describe a sink binding. | ||
|
||
### Synopsis | ||
|
||
Describe a sink binding. | ||
|
||
``` | ||
kn source binding describe NAME [flags] | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
# Describe a sink binding with name 'mysinkbinding' | ||
kn source binding describe mysinkbinding | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
-h, --help help for describe | ||
-n, --namespace string Specify the namespace to operate in. | ||
-v, --verbose More output. | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string kn config file (default is $HOME/.kn/config.yaml) | ||
--kubeconfig string kubectl config file (default is $HOME/.kube/config) | ||
--log-http log http traffic | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [kn source binding](kn_source_binding.md) - Sink binding command group | ||
|
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,44 @@ | ||
## kn source binding list | ||
|
||
List sink bindings. | ||
|
||
### Synopsis | ||
|
||
List sink bindings. | ||
|
||
``` | ||
kn source binding list [flags] | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
# List all sink binding in YAML format | ||
kn source binding 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 config file (default is $HOME/.kn/config.yaml) | ||
--kubeconfig string kubectl config file (default is $HOME/.kube/config) | ||
--log-http log http traffic | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [kn source binding](kn_source_binding.md) - Sink binding command group | ||
|
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 source binding update | ||
|
||
Update a sink binding. | ||
|
||
### Synopsis | ||
|
||
Update a sink binding. | ||
|
||
``` | ||
kn source binding update NAME --subject SCHEDULE --sink SINK --ce-override OVERRIDE [flags] | ||
``` | ||
|
||
### Examples | ||
|
||
``` | ||
# Update the subject of a sink binding 'my-binding' to a new cronjob with label selector 'app=ping' | ||
kn source binding update my-binding --subject cronjob:batch/v1beta1:app=ping" | ||
``` | ||
|
||
### Options | ||
|
||
``` | ||
--ce-override stringArray Cloud Event overrides to apply before sending event to sink in the format '--ce-override key=value'. --ce-override can be provide multiple times | ||
-h, --help help for update | ||
-n, --namespace string Specify the namespace to operate in. | ||
-s, --sink string Addressable sink for events | ||
--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 | ||
``` | ||
|
||
### Options inherited from parent commands | ||
|
||
``` | ||
--config string kn config file (default is $HOME/.kn/config.yaml) | ||
--kubeconfig string kubectl config file (default is $HOME/.kube/config) | ||
--log-http log http traffic | ||
``` | ||
|
||
### SEE ALSO | ||
|
||
* [kn source binding](kn_source_binding.md) - Sink binding command group | ||
|
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
Oops, something went wrong.