Commit Graph

326 Commits

Author SHA1 Message Date
Navid Shaikh 15dec583ca
Implement human readable output for kn route describe (#643)
* 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
2020-02-10 07:46:07 -08:00
David Simansky 50ae82b0cc Fix capitalization of generated flags (#638)
Co-authored-by: Roland Huß <rhuss@redhat.com>
2020-02-08 06:48:14 -08:00
David Simansky 8d2ecca7ae
Rename --async to --no-wait and deprecate it (#639)
* Rename --async to --no-wait and deprecate it

* Polish wording of deprecation warning message
2020-02-08 02:52:14 -08:00
Lv Jiawei 16bbfa37ed
Add E2E test for "kn source binding" commands (#634)
Fixes #631

* Add E2E test for "kn source binding" commands.
* Fix typo.
2020-02-07 14:37:14 -08:00
Roland Huß f634ab90c0
fix(serving): Add an error window for ReadyCondition (#644)
* fix(serving): Add an error window for ReadyCondition

A default error window of 2 seconds (not sure if this should be made configurable
as it is hard to explain/document) cause return an error during
sync operations only, if a ReadyCondition == false stays for that
long in false. This is needed to compensate situation where the
condition is false when a race between revision and route creation
occurse during a service creation.

This should fix the flakes we have in our E2E tests as described in #544.

* fix: words, words

* fix(serving): More words + a check
2020-02-07 12:06:14 -08:00
Roland Huß c3f77df0d6
fix(serving): Fix test method wording (#642) 2020-02-07 03:06:13 -08:00
Roland Huß 1b9a76bc31
feature(serving): Update API to serving.knative.dev/v1 (#640)
* 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
2020-02-07 02:03:14 -08:00
David Simansky e88a873b27
Add e2e test for cmd and arg options (#637) 2020-02-05 09:50:31 -08:00
David Simansky ffdeafe33e
Add support for command and args in service create (#635)
* Add support for command and args in service create

* Add tests for new update functions
2020-02-04 08:45:31 -08:00
Lv Jiawei d82d55731c
Show envFrom when running describe service or revision (#630)
Fixes #626

Show envFrom when running describe service or revison. The result like:
EnvFrom:  cm:test1, cm:test2
2020-02-02 00:19:29 -08:00
Roland Huß 0e5d1a86c8
chore(e2e): Update dependency to eventing v0.12.0 (#628)
* chore(e2e): Update dependency to eventing v0.12.0

* chore: update infa script dependencies

* chore: Update testinfra dep
2020-01-31 02:20:28 -08:00
Roland Huß 164cb5f362
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
2020-01-29 12:08:27 -08:00
Roland Huß dfd6defcd1
chore: Update changelog for 0.12.0 release (#627) 2020-01-29 11:36:28 -08:00
Ying Chun Guo 00da0064a0 Improve 'source apiserver update --resource' (#590)
* improve 'source apiserver update --resource' to follow the common update semantics

* add more tests and update based on comments

* rebase
2020-01-28 06:49:26 -08:00
dr.max 606de80741 fixes(#598): checks for namespace creation instead of waiting (#611) 2020-01-24 13:44:24 -08:00
Navid Shaikh ff7dffc0a3 Add --pull-secret flag (#617)
* 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
2020-01-22 06:57:25 -08:00
Roland Huß 599f1a5203 chore: Update k8s dependencies and cleaned up a bit (#622)
* chore: Update k8s dependencies and cleaned up a bit

* chore: Moved to k8s 1.16.4 like for serving & eventing

* fix: Add missing go.sum line
2020-01-22 04:57:23 -08:00
Navid Shaikh 8c417c1226 Vendor serving v0.12.0 (#618)
- Vendor serving release v0.12.0
 - Update `kn version command` to print serving v0.12.0
 - Update latest release e2e tests script to setup serving v0.12.0

Co-authored-by: Roland Huß <rhuss@redhat.com>
2020-01-22 00:48:23 -08:00
Roland Huß 5001dcdc16 feature(serving): Add --autoscale-window (#614)
* feature(serving): Add --autoscale-window

Fixes #613

* chore: Update help-text for --autoscale-window

* chore: Add missing generated files
2020-01-22 00:18:23 -08:00
Scott Nichols 9fd763e5dd migrate to the new eventing legacy client (#621)
* migrate to the new eventing legacy client

* ran go mod tidy

* found the ./hack/build.sh file and ran it.
2020-01-21 23:15:23 -08:00
Daniel Helfand a56afabc8a remove printing err when running root command (#615) 2020-01-21 09:58:05 -08:00
Murugappan Chetty de7e3880d4 Fix misleading error message when verb is bad (#589)
* 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)
2020-01-19 23:47:04 -08:00
Roland Huß f26fdb4297 refactor,fix(revision list): Refactoring and fixing issues (#605)
* 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
2020-01-16 13:05:03 -08:00
Navid Shaikh fc488d98c2 Update test-infra: Eventing nightly release YAML rename (#610)
per d5990f0e5a
2020-01-16 11:25:04 -08:00
Roland Huß 1506cb3cf8 refactor(service list): Removed special "default" namespace handling (#608)
Fixes #607.
2020-01-14 07:15:08 -08:00
Ying Chun Guo 71c9238b7e Enable trigger filter to be optional (#603)
* Enable trigger filter to be optional

* remove RemoveFilters from builder
2020-01-13 23:33:04 -08:00
dr.max 3c23f6ad4e simplified service update message to user (#587)
```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
```
2020-01-10 07:16:56 -08:00
Navid Shaikh 6ab9980e16 chore(e2e): Namespace specific k8s resources for tests (#597)
* chore(e2e): Namespace specific k8s resources for tests

 Completes #576
 - For ApiServer source: ClusteRole and ClusterRoleBinding name(s)
   are now test-namespace specific. They are cleared in test's tearDown method.
 - Use constant prefix as:
  clusterRolePrefix        = "apiserver-role-"
  clusterRoleBindingPrefix = "apiserver-binding-"
 - Use constant ServiceAccountName as:
  testServiceAccount = "apiserver-sa"
 - Rename methods and cleanup.

* Use correct format specifier for error as %v instead of %s
2020-01-10 06:50:56 -08:00
dr.max ac2170c1e2 feature(#580): adds traffic and tags information to revision list (#581) 2020-01-10 04:43:56 -08:00
Navid Shaikh b8d571678f chore(e2e): Update tektoncd pipeline release to v0.9.2 (#594)
Fixes #601

 - Also replace deprecated `serviceAccount` with `serviceAccountName`
 - Sync helloworld test image code from https://github.com/knative/docs/tree/master/docs/serving/samples/hello-world/helloworld-go
 - Use local version of buildah task instead of one from catalog, adding `--format=docker` in `buildah bud` command
   - to build and push the image to registry in docker format to match the manifestype `application/vnd.docker.distribution.manifest.v2+json`
 - Update pipeline to add parameter BUILDER_IMAGE and sets it to quay.io/buildah/stable:latest
2020-01-10 03:42:56 -08:00
dr.max a0910db9a9 adds e2e tests for plugins (#591) 2020-01-09 01:25:54 -08:00
Murugappan Chetty 5ecad782d6 review comments for pr 555 (#602) 2020-01-08 15:17:53 -08:00
Martin Gencur 0aa2299818 Remove redundant cleanup in Tekton tests (#600)
* tear down only if the test passes, we want to keep the pods otherwise
so that the dump will show their errors
2020-01-07 10:17:51 -08:00
Lv Jiawei 9de6e612ef Add E2E tests for CronJob source (#599)
Fixes #566
2020-01-07 02:49:51 -08:00
Lv Jiawei e0877da3d6 Delete k8s cluster resource in e2e test (#596)
Fixes #576
2020-01-06 06:59:49 -08:00
Lv Jiawei 99d8b2269b Handling map like options in a same way (#592)
Fixes #577
2020-01-01 22:57:41 -08:00
Naomi Seyfer f1bfafebcc Allow for http and broker sinks (#574)
* 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
2019-12-27 02:54:30 -08:00
Ying Chun Guo d03cbf904c Use the same list flags for list_type, service and route (#582) 2019-12-20 04:50:33 -08:00
dr.max b640219140 load config values from viper if present in config (#468)
* init config flags in root cmd's PersistentPreRunE

* change Cfg.LookupPlugins to pointer to bool

* simplified logic in setting initial config flags from viper config
2019-12-19 02:24:31 -08:00
Lv Jiawei 2b518d1e4e Retrurn error if exist duplicate key in filter option (#575)
fix #569
2019-12-19 01:25:31 -08:00
Navid Shaikh 4486b36782 Fix link in CHANGELOG (#573) 2019-12-18 04:22:05 -08:00
Roland Huß b10580ff72 chore(trigger): Cleanup Trigger create API (#561)
* further updates

* chore: Fix calls to apiserver create

* fix namespace issue

* fix
2019-12-17 13:39:04 -08:00
Roland Huß e793090399 chore(Changelog): Preparation for v0.11.0 (#560)
* chore(Changelog): Preparation for v0.11.0

* Update CHANGELOG.adoc

* Update CHANGELOG.adoc

* Update CHANGELOG.adoc
2019-12-17 12:20:04 -08:00
Navid Shaikh 6380fc5eaf Add cronjob and apiserver source list commands (#559)
* Add kn source cronjob list command

* Add kn source apiserver list command
2019-12-17 08:29:04 -08:00
Ying Chun Guo 8b1434b789 Add trigger update command (#562)
* add trigger update command

* add trigger update test
2019-12-17 07:10:04 -08:00
Ying Chun Guo 60b88017a9 add trigger list (#558) 2019-12-17 01:00:08 -08:00
Murugappan Chetty 8a9d8fcc94 Add readme for tests (#554) (#555)
* Add readme for tests (#554)

* add step to run test case selectively

* add step to run test case selectively

* add step to run test case selectively

* add step to run test case selectively

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* Update test/README.md

Co-Authored-By: Navid Shaikh <nshaikh@redhat.com>

* review changes for pr #555

* review changes for pr #555

* review changes for pr #555

* review changes for pr #555

* review changes for pr #555

* review changes for pr #555
2019-12-16 23:18:02 -08:00
Navid Shaikh 6ac25cdc00 Add ApiServer source update and describe commands (#556)
* 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
2019-12-16 09:42:01 -08:00
Ying Chun Guo 7def9f49eb Add command for creation of a plain trigger (#541) 2019-12-16 07:41:01 -08:00
Roland Huß 0ca6f14d4a feature(source cronjobs): Implementation of CronJobSource management (#542)
* 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
2019-12-13 01:27:53 -08:00