* Implement human readable output for kn route describe
- Keeps the machine readable output
- Align the command description text, check for single argument, reported error messages and unit tests in service, revision, route, source binding describe commands
* Dont print separate section for owner references
* Print Service heading irrespective of owner.Kind == Service
* Align desc, err msg for trigger, apiserver and cronjob source
* feature(serving): Update API to serving.knative.dev/v1
Due to an issue with 0.12.0 (a missing constant) the update also includes an update
to the latest knative-serving and knative-eventing dependencies from master
(as reflected in version.go)
Signed-off-by: Roland Huß <roland@ro14nd.de>
* fix(serving): Bogus import removed
* fix(serving): Add missing go.sum entry
* 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
* Add --pull-secrets flag
Fixes#616
- Add --pull-secrets flag for service create/update operations
- Setting empty string to flag clears the pull secrets
- List ImagePullSecrets for service in `service describe` default output
- Run e2e tests against latets serving v0.12.0 (ImagePullSecrets introduced in v0.11.1 release)
* Space separated field name for describe and update flag help msg
- Update the key name in service describe:
- ImagePullSecrets --> Image Pull Secrets
- ServiceAccount --> Service Account
- Update the help message for --service-account and --pull-secrets
* validate sub command verb (#557)
* fix review comments for pr #555
* validate sub commands
* update error message
* use inner args returned by find func
* return appropriate error message for #557
* return appropriate error message for #557
* Revert "fix review comments for pr #555"
This reverts commit 14ea8d2dc6.
* review comments for pr 589
* misleading error message when verb is bad (#557)
* misleading error message when verb is bad (#557)
* misleading error message when verb is bad (#557)
* refactor,fix(revision list): Refactoring and fixing issues
This PR fixes the following issues of `kn revision list`:
* `kn revision list -A` didn't work as the internal service-get requires a namespace (that from the revision)
* `kn revison list -s myservice myrevision` was not supported
* Service caching assumed that the revision list returned by the server is grouped by servicename. This is not guaranteed.
* `kn revision list -o yaml` returned yaml with the artificial and bogus annotations used for printing out in columns.
The following refactorings were added:
* The main run function was simplified and splitted up in multiple methods
* List-filter handling was made straight forward (and hopefully easier to understand)
I abandoned my initial intention to remove the bogus, temporary, in-memory set annotations for tags and traffic as it does not fit well with the resource printer framework which only works with original K8s resource runtime.Object (and e.g. use serialization directly). I still don't like the hackish approach to add to annotatin (please note, how I need to write a wrapped printed to get rid of the annotations for fixing the `-o yaml` use case, which otherwise prints out those annotations, which are not existant on the server side), but for the sake of simplicity let's keep this (not dogmatic here).
* chore: Simplified
* chore: Some docs update
* fix: wtf
* fix(revision list): Add Namespace column for -A and unified list handling
* fix(revision list): truncate long columns
* add(revision list): Unit test for extracting target and tags
* fix(revision list): Add missing license header
* fix(revision list): Formatting issue
* fix: formatting
* chore: Some cosmetics
```bash
➜ client git:(master) ✗ ./kn service update summary-fn --untag sync1
Using kn config file: /Users/maximilien/.kn/config.yaml
Updating Service 'summary-fn' in namespace 'default':
0.089s Ready to serve.
Service 'summary-fn' with latest revision 'summary-fn-nxqwb-41' (unchanged) is available at URL:
http://summary-fn-default.kndemo-267179.sjc03.containers.appdomain.cloud
➜ client git:(master) ✗ ./kn service update summary-fn --image docker.io/drmax/summary-fn:latest
Using kn config file: /Users/maximilien/.kn/config.yaml
Updating Service 'summary-fn' in namespace 'default':
0.091s The Configuration is still working to reflect the latest desired specification.
6.317s Ready to serve.
Service 'summary-fn' updated to latest revision 'summary-fn-jfjcy-42' is available at URL:
http://summary-fn-default.kndemo-267179.sjc03.containers.appdomain.cloud
```
* Introduce Broker as a kind of sink, genericize sinks in general
* loltest
* Fix tests for mergeout
* the test file I forgot
* docstrings
* Move fake dynamic client into seprate file
* Pass whole client, not raw client, to resolve sinks
* one more test
* Dont return created ApiServer source object but only error
- After ApiServer source object is created, we don't need it to pass
around in caller function.
* Align creating ApiServer source client, removes unit tests
* Add ApiServer source update command
* Rename TestMockKnClient to TestMockKnCronJobSourceClient
* Add mock client for ApiServer Source and its tests
* Add mock unit tests for create, delete and update
* Add e2e tests for apiserver source update
- Add a test for apiserver source sink update
- Verify the updated sink name after the apiserver source is created
- Update resource names in existing tests
* Uses builder pattern for ApiServer source create command
* Update ApiServer source create/update flags and required config
* Uses builder pattern for ApiServer source update command
* Align create/update/delete description and error messages
* Add unit tests for get/create/update/delete in apiserver_client.go
* Update e2e tests expected output per change in commands output
* Golint fixes, Api -> API and add exported method docs
* Rename a test method and source update command description
* Add ApiServer source describe command
- Add command and unit tests
- TODO for later: Add 'Controller Selector' section for --verbose
* feature(source cronjobs): Implementation of CronJobSource management
Contains create/delete/update/describe but not tests yet.
Still todo:
* Think how to provide a namespace for the sink
* Support for more sinks
* Synchronous mode for create & update
* Add list (or implement "source list")
* chore: Add a mock test for cronjob source
* addd missing license headers
* cosmetic changes
* chore(cronjobsource): Add tests
* fixup
* chore(cronjob source): Improved test coverage
* chore(cronjob source): some review polishing
- Pin contrib.go.opencensus.io/exporter/stackdriver@59d068f8d8ff5b653916aa30cdc4e13c7f15d56e
- Pin knative.dev/pkg@release-0.11
- Move `Destination` from (knative.dev/pkg) v1alpha1 to duckv1beta1
- Run tests against Eventing v0.11.0
* feat: kn source list-types (builtin types)
- Only lists the builtin source types
- Uses client-go dynamic client for listing CRDs
- Adds DyanmicClient interface to KnParams
- Adds printing options
* chore(lint): Address golint suggestions
* Rebase and update venodr/modules.txt
* Adds unit tests for DynamicClient in types.go
* Add kn source list-types command in smoke tests
* Constants for the CRD GVR and source identifier label key value
GVR as:
- Group: apiextensions.k8s.io
- Version: v1beta1
- Resource: customresourcedefinitions
Label as:
{"duck.knative.dev/source": "true"}
* Add tests for dynamic client
* Add description about SinkBinding source type
as - "Binding Pattern for ContainerSource"
* Remove unused imports
* Adds unit tests for list-types command processing
* More unit tests for flags
* Adds e2e tests for kn source list-types
- also test the YAML output
* Sort the source types while listing them
- Update the unit tests accordingly
* Add examples
* Add unit tests for CreateDynamicTestKnCommand
* Fix typo in unit tests
* golint fixes
* Updates to vendor/modules.txt after rebase
* Remove the extra lines
* refactor delete service unit test with mock kn client (#358)
* refactor list svc unit test with mock kn client (#358)
* refactor list svc unit test with mock kn client (#358)
* fix review comments for pr 527 (#358)
* fix review comments for pr 527 (#358)
* chore: Add version information of eventing
Adding sources.eventing.knative.dev to version info (the only eventing API)
for now as this will be the first one used.
* chore(version): Add grouping for API versions
While testing I specified this on the `kn` command line:
```
./kn service create echo --concurrency-limit=1 --concurrency-target=1 --env foo=bar --limits-cpu=1000m --limits-memory=1024m --max-scale=1 --min-scale=1 --port=9999 --requests-cpu=250m --requests-memory=64mi --image duglin/echo
```
and it returned:
```
unable to parse quantity's suffix
```
I had no idea which value it didn't like. So this PR makes it so the output
is now this:
```
Error parsing "64mi": unable to parse quantity's suffix
```
Still not perfect since I still had to think way too hard to realize that it
didn't like the lower-case `m`, but that's a different issue.
Signed-off-by: Doug Davis <dug@us.ibm.com>
* Add support for envFrom, volumeMounts, serviceAccountName, and imagePullPolicy
* Add comments for added functions
* Add test functions for --env-from
* Add test functions for --volume-mount
* Add test functions for --service-account-name and --image-pull-policy
* Add testing functions to cover the case "service update --env-from"
* Add test functions to cover the case "service update --volume-mount"
* Add missing test functions for config_changes.go
* Add testing functions for pkg/util/parsing_helper.go
* Fix a bug on a test case, caused by ignoring random orderedness of map
* Remove image-pull-policy because it is not supported by Knative
* Fix comments to clarify it as well as to fix a typo
* Remove service-account-name flags in order to submit it as a seperate PR
* Split --volume-mount flag into --volume-mount and --volume flags in order to enable multiple times mounting for the same volume
* Change the name of local variable to simplify
* Update docs
* Change the flag "--volume-mount" into "--mount", and fix it to make volume automatically when the config-map or secret is directley used. In addition, the test cases are changed to new unit test style. To keep the original orderedness given via flags, OrderedMap implementation is added as well
* Fix usage descriptions for the mount flag
* Factor out the name existence checking from createEnvFromSource
* Fix the usage description for --mount
* Sanitize a generated volume name
* Revision describe rebaseable
* Fix up for rebase
* Some tests
* moretests
* Forgot part of the refactor!
* Fix unit tests
* Change e2e tests and respond to feedback
* Adds zsh completion
- Adds back zsh completion after vendoring cobra library with a fix
- Updates the command definition to accept argument either of ['bash', 'zsh']
- Moves the completion command definition under `pkg/kn/commands/completion`
- Updates docs
- Updates CHANGELOG.adoc
* fix(golint): exported function should have comment
* Fixes PR number in CHANGELOG.adoc
* Updates unit tests