Commit Graph

1263 Commits

Author SHA1 Message Date
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
Ying Chun Guo f4b5703972 add apiserver create/delete e2e test (#552) 2019-12-12 09:09:52 -08:00
Roland Huß 2861f37ece chore: Update version to v0.11.0 of serving and eventing (#549) 2019-12-11 13:06:49 -08:00
Roland Huß b9dadf650e chore: Refactor mock testing (#548)
This makes it easier for other components (like eventing) to introduce an own
mock for their tests.
2019-12-11 10:27:49 -08:00
Navid Shaikh 2c1e5dc88d Selectively run e2e tests for serving, eventing (#547)
- Run only serving specific e2e tests locally
  ```
  E2E_TAGS="serving" ./test/e2e-tests-local.sh
  ```

 - Run only eventing specific e2e tests locally
  ```
  E2E_TAGS="eventing" ./test/e2e-tests-local.sh
  ```

 - Run all e2e tests locally
  ```
  ./test/e2e-tests-local.sh
  ```
2019-12-11 03:58:48 -08:00
Navid Shaikh 4128022fb7 Update deps using go 1.13 (#535)
- Commit results of codegen using go 1.13
 - Update DEVELOPMENT.md to mention go 1.13
2019-12-11 02:38:49 -08:00
Navid Shaikh f0a40d1b4b Vendor eventing v0.11.0 and run tests against it (#546)
- 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
2019-12-11 00:21:48 -08:00
Navid Shaikh 4f0eb99f8e Vendor serving v0.11.0 and run tests against it (#545)
* Vendor serving v0.11.0

* Run tests against serving v0.11.0
2019-12-10 21:14:48 -08:00
Navid Shaikh 7dbb5a5bb0 kn source list-types (builtin types) (#536)
* 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
2019-12-10 11:20:47 -08:00
Ying Chun Guo 003dba3616 Add creating ApiServerSource event source to Client (#415) 2019-12-10 03:52:46 -08:00
Murugappan Chetty 8e010d0cbd service describe command : Move Cluster URL to --verbose from default output (#543)
* move cluster url to verbose in svc desc

* move cluster url to verbose in svc desc
2019-12-09 23:55:46 -08:00
Navid Shaikh 5deba393cb Explicit name for serving client (#537)
* Explicit name for serving client

 - Renames NewClient to NewServingClient, since now we're adding more clients

* Add cover.html in gitignore
2019-12-08 23:42:44 -08:00
Chi Zhang a8e017b945 remove unused test flag (#540) 2019-12-08 23:16:44 -08:00
Navid Shaikh ed25066cf6 Eventing setup in CI (#538)
* Eventing setup in CI

  - Update test-infra
  - Use library functions for setting up released and latest Eventing
  - Set up Eventing 0.10.2 and nightly release in `latest-release` and default e2e tests CI job respectively

* Fix typo in variable name and update formatting
2019-12-06 10:39:40 -08:00