Commit Graph

479 Commits

Author SHA1 Message Date
Nghia Tran 1fd2844f31
Pin to knative.dev/{pkg,eventing,serving}@release-16 (#921) 2020-07-08 04:15:47 -07:00
Mike Petersen 4bc9a42faa
Fixed the error message for min/max scale tests (#919)
* Fixed the error message for min/max scale tests

* Updated in update_test.go as well
2020-07-07 14:13:47 -07:00
Himanshu Ranjan e6f125fd4e
Add support for service url in svc describe output (#916)
* Add support for service url in svc describe output

* Add changes in CHANGELOG.adoc

* Update CHANGELOG.adoc

Co-authored-by: Matt Moore <mattmoor@vmware.com>

* Add url as output format in kn service describe --help command

* Build locally and autogenerated doc

* Change service describe help message for consistency

Co-authored-by: Matt Moore <mattmoor@vmware.com>
2020-07-07 13:44:44 -07:00
Navid Shaikh 1a8cf96997
Setup eventing extension sugar controller (#920)
We'll need sugar controller for reconciling broker for tests
 which labels namespace and annotates the triggers.

 Currently, sugar controller is not part of the eventing nightly release setup
 by test-infra libs. This changeset adds install of same for nightly
 CI setup.
2020-07-07 12:37:44 -07:00
Navid Shaikh 4ee2dc4fd3
Use broker injection label key from trigger types (#917)
- do not hard code as there is a change coming it in eventing v0.16 release
2020-07-07 04:14:44 -07:00
Navid Shaikh 4b62f2008b
Find sink and ready conditions for untyped source (#911)
* Find sink and ready conditions for untyped source

 Fixes #909
 - Look up spec.sink field in untyped source unstructured object and
   try to convert it to duck Destination object
 - Look up status.conditions field in untyped source unstructured object and
   try to convert it to duck Conditions object
 - Upon not finding the data at expected fields, return "<unknown>"

* Add unit tests

* Update LICENSE header
2020-07-01 17:06:42 -07:00
Daniel Helfand 875247a8b1
add missing assertions for command unit tests (#908) 2020-06-25 22:24:28 -07:00
Daniel Helfand ab679489b1
Fix Panic for kn source apiserver and kn source binding describe with Sink URI (#901)
* fix panic for apiserver and binding describe and update tests

* add changelog entry

* include namespace and kind for sink in test coverage

* assert no URI in non Sink URI test cases

* add createSinkv1 for creating Sink test data
2020-06-25 08:00:28 -07:00
David Simansky a7f18cbeee
chore: Add broker management feature to changelog (#905) 2020-06-23 11:26:27 -07:00
David Simansky 1f59f5341c
Add broker create, delete and list cmds (#894)
* Add broker create, delete and list cmds

* fix: Fix copyright headers

* fix: Fix linter warnings

* Update pkg/kn/commands/broker/create.go

Co-authored-by: Roland Huß <rhuss@redhat.com>

* Update pkg/kn/commands/broker/delete.go

Co-authored-by: Roland Huß <rhuss@redhat.com>

* Update pkg/kn/commands/broker/list.go

Co-authored-by: Roland Huß <rhuss@redhat.com>

* feat: Add broker describe command

* fix: Fix copyright header

* fix: Fix linter issues

* fix: Fix broker describe test

* fix: Fix order of eventing cmds

* chore: Add e2e tests

* fix: Fix e2e tests annotation

* fix: Reorder e2e tests methods

* feat: Add synchronous broker delete option

* fix: Fix broker describe example

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* fix: Fix variable name

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* fix: Fix broker list example formatting

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* fix: Fix eventing client func name

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* fix: Reflect changes from PR review suggestions

* fix: Fix formatting of cmd examples

* fix: Fix formatting of cmd examples & trailing spaces

* fix: Polish eventing client docs

* fix: Fix examples alignment

Co-authored-by: Roland Huß <rhuss@redhat.com>
Co-authored-by: Navid Shaikh <nshaikh@redhat.com>
2020-06-23 02:43:26 -07:00
Roland Huß 94e84d4ee0
fix: Add mandatory --sink to ping source command's name (#903) 2020-06-23 00:45:26 -07:00
Daniel Helfand 607e366bc2
fix panic for kn trigger describe with Sink URI (#900) 2020-06-21 22:24:26 -07:00
Navid Shaikh f82b323a90
Carry CHANGELOG of v0.15.2 release to master (#897) 2020-06-19 07:25:25 -07:00
Navid Shaikh 887d367861
Refer broker from v1beta1 APIs and add missing e2e tests (#895)
* Move broker injection namespace label, unlabel utilities to lib

* Refer broker from eventing v1beta1 APIs

* Add e2e test for refering default broker as sink

* Fix unit tests
2020-06-19 05:43:25 -07:00
Roland Huß 10b23b8802
chore: add missing CHANGELOG entry for grouped help messages (#893) 2020-06-18 14:11:25 -07:00
Murugappan Chetty f869b44d66
add kn export type (#856)
* add kn export type

* add kn export type

* add kn export type

* Update pkg/apis/client/register.go

Co-authored-by: Matt Moore <mattmoor@vmware.com>

* e2e test for kn export type

* e2e test for kn export type

* add new type for kn export

* rebase

* rebase

Co-authored-by: Roland Huß <rhuss@redhat.com>
Co-authored-by: Matt Moore <mattmoor@vmware.com>
Co-authored-by: Roland Huß <roland@ro14nd.de>
2020-06-18 02:33:25 -07:00
Roland Huß b916a5b3ed
Add grouping for help message + streamlined help messages (#887)
* Add grouping for help message + streamlined help messages

The top-level looks like

kn is the command line interface for managing Knative Serving and Eventing objects

 Find more information about Knative at: https://knative.dev

Serving Commands:
  service     Manage Knative services
  revision    Manage service revisions
  route       List and show service routes

Eventing Commands:
  source      Manage event sources
  trigger     Manage event triggers

Other Commands:
  plugin      Manage kn plugins
  completion  Output shell completion code
  version     Show the version of this client

Use "kn <command> --help" for more information about a given command.
Use "kn options" for a list of global command-line options (applies to all commands).

The following changes have been applied:

* Add CommandGroups for grouping commands together
* Add flexible templating for the help messages
* Moved global options to an own command ('kn options', much like 'kubectl options')
* Aligned wording and typography of help messages

These features has been highly inspired by kubectl grouping & help templating but has been considerably been stripped down to the needs of kn.

Signed-off-by: Roland Huß <roland@ro14nd.de>

* chore: Add missing file

* Update pkg/templates/command_groups.go

Co-authored-by: Matt Moore <mattmoor@vmware.com>

* chore: Add some test for error messages

* fix formatting

* chore: Add test

* moar tests

* Update pkg/kn/commands/completion/completion.go

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* Update pkg/kn/commands/source/apiserver/delete.go

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* Update pkg/kn/commands/service/list.go

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* Update pkg/kn/commands/route/route.go

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* Update pkg/kn/commands/revision/delete.go

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* Update pkg/kn/commands/plugin/plugin.go

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* Update pkg/kn/commands/service/delete.go

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* Update pkg/kn/commands/revision/delete.go

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* Update pkg/kn/commands/service/delete.go

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* regen docs

* chore: Update conventions doc

* Move some direct configuration of rootcmd to NewRootCommand()

* Moved CaptureOutput to "test" package for reuse

Co-authored-by: Matt Moore <mattmoor@vmware.com>
Co-authored-by: Navid Shaikh <nshaikh@redhat.com>
2020-06-18 00:06:25 -07:00
Roland Huß c7426459be
Refactor main flow and introduce explicit plugin and config handling (#877)
* Refactor main flow, plugin and configuration handling

* The plugin handling has been moved out of the `KnDefaultCommand` constructor where it was executed as a side-effect. The original code from `kubectl` suffers from the same issue that plugin handling is not a top-level concern but was very likely introduced as an after-thought. Instead, the plugin handling is done now by a `PluginManager` which is explicitly called in `main()`.
* Configuration and bootstrap option handling is centralized in the package `option`. After the bootstrap happened, the content of the configuration file, as well as any other global configuration, can be obtained from methods on  `config.GlobalConfig`. Also, all flag handling is delegated to cobra so that no own parsing is needed.
* Many of the logic in `pkg/kn/commands/plugin` for plugin management has been moved up to `pkg/kn/plugin` as this code is not only relevant for `plugin list` but also for the bootstrap process.

* fix: invalid subcommands will lead to a proper error message

* Update pkg/kn/config/types.go

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* Update pkg/kn/plugin/manager.go

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* Update hack/generate-docs.go

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* Update hack/generate-docs.go

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* chore: Add missing links

* chore: recert to shas in links in developer guide for now.

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>
2020-06-15 09:15:24 -07:00
Daniel Helfand 3f146b14db
Return Error Message from Using --untag with Nonexistent Tag (#880)
* return error message from using --untag with nonexistent tag

* improve err message for --untag and add e2e test

* change untagRevision to return bool and add traffic e2e tests

* update changelog
2020-06-10 23:22:23 -07:00
Roland Huß ff350fb6a7
Fix build.sh for macOs users (#883)
* Fix build.sh for macOs users

Fixes #882

* cleanup tempdir after installing
2020-06-09 06:42:32 -07:00
Dave Protasowski dfd65db9ab
bump k8s packages to 1.17.6 (#881)
* add script to bump k8s deps

* bump k8s to v1.17.6
2020-06-08 15:30:32 -07:00
Dave Protasowski a7ea77d106
Update go.mod to specify the module is go1.14 (#866)
* Update go.mod to specify the module is go1.14

Thus the go commands will default to -mod=vendor

See: https://golang.org/doc/go1.14#go-command

* install goimports as a tool

* drop mod=vendor usage as that's the default with go1.14

* remove comment about using -mod=vendor

* Revert "drop mod=vendor usage as that's the default with go1.14"

This reverts commit 567004d404bb7ebd39ed527dc75759cfc7db672f.

* Revert "remove comment about using -mod=vendor"

This reverts commit 2a71393a2015c1539be1503e0c52cf64283e12d0.

* Revert "install goimports as a tool"

This reverts commit 9616d5e2d2ab0d61e8454b1ace057ec9712e182d.

* use go_run_tool to run goimports

* inline go_run_tool

* include required env var REPO_ROOT_DIR
2020-06-08 13:40:32 -07:00
Roland Huß 2a42ee1a33
chore: Move from Eventing v1alpha1 to v1beta1 (#878) 2020-06-08 05:42:19 -07:00
Chi Zhang 3c5ceff655
update test-infra to stop using serving.yaml (#876) 2020-06-04 23:32:18 -07:00
Navid Shaikh c1ab4ae863
Update flag names to --request and --limit (#872)
* Update flag names to --request and --limit

 - Use singular flag names and support comma separated or repeated flag values
 - Update tests and docs

* Update CHANGELOG

* Update the flag description and examples

* Remove release 0.15.0 header from CHANGELOG
2020-06-03 04:04:18 -07:00
Roland Huß 3a242c7604
chore: Unpin dependencies to follow master again (#870)
Reset version to "master" and update-deps.sh --upgrade after branching off for release-0.15
2020-06-02 08:02:17 -07:00
Roland Huß fc6f379d94
chore: Preps for release 0.15.0 (#869) 2020-06-02 03:35:17 -07:00
Navid Shaikh af2d4c8f2a
chore(e2e): Run tests against serving and eventing 0.15 release (#868) 2020-06-02 02:05:16 -07:00
Daniel Helfand 834ee79049
do not check for plugin executable if none on path (#846) 2020-06-02 01:38:16 -07:00
Roland Huß b7fc4c3906
chore: Remove OWNERS files in vendor/ when updating deps (#867)
* chore: Remove OWNERS files in vendor/ when updating deps

* chore: Remove OWNERS also in build.sh
2020-06-01 19:25:03 -07:00
Lv Jiawei bcf2ec3de8
Check deletionTimestamp for "kn revision delete" (#860)
* Check deletionTimestamp for "kn revision delete"

Fixes: #815

* Update error message for revision delete

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>
2020-06-01 04:02:03 -07:00
dr.max e1ad66a60d
* allow plugins to extends all comamnd groups, e.g., kn-service-blah is OK (#834)
* prevent plugins that shadow commands of exsiting groups, e.g., kn-service-create is NOT OK
* list plugins that extend existing groups
* warn plugins that shadow command of existing groups
* add UTs for above
2020-06-01 03:07:03 -07:00
Navid Shaikh c1de0add97
Add --ce-override flag for apiserver and ping sources (#865)
* SinkBinding: Support update and remove of cloud events extensions

 - Add unit tests
 - Update flag description
 - Update parsing utilities for map

* APIServer: Add, update and remove cloud events extensions

 - Add --ce-override flag
 - Add unit tests

* PingSource: Add, update and remove cloud events extensions

  - Add --ce-override flag
  - Add unit tests

* Update CHANGELOG

* Update binding builder method name to CloudEventOverrides

* Fix lint warnings

* Add ceoverrides to unit test objects

* Update PR number in CHANGELOG

* Show ce-override extensions in describe output
2020-06-01 02:39:03 -07:00
Navid Shaikh d8a9692268
Add description for ContainerSource (#864)
for output of `kn source list-types`
2020-05-28 07:56:00 -07:00
Navid Shaikh cdf6f29880
Add --requests and --limits resource flags (#859)
* Add --requests and --limits resource flags

  Fixes #490

  - Add deprecation message for --requests-cpu, --requests-memory,
  --limits-cpu and --limits-memory flag usage.

  - Add error message if new and deprecated, requests and limits flags
    are used together.

* Add resources requests and limits example for service create

* Add mock style unit tests

* Update existing unit tests for deprecated flags

* Add integration tests

* Add CHANGELOG entry

* Fix lint warnings

* Add unit tests for resource flags

* Fix typo for service name in e2e tests

* Refactor resource validation utility into test lib

* Remove commented out code

* Add references about managing resources and GPU in example

* Update image references in examples
2020-05-28 01:45:59 -07:00
Navid Shaikh 8c4a28e466
docs: Update kn service create examples with real image (#862)
Fixes #673
 - uses image: `knativesamples/helloworld`
2020-05-27 17:21:59 -07:00
Martin Gencur c6537a8e84
Update Tekton resources to v1beta1 (#861)
* Update to Tekton v1beta1

* replace PipelineResource with Task

* Pull kn task from github
2020-05-27 06:31:59 -07:00
Roland Huß 93c58d294d
chore: Pinning to k8s version 0.16.4 like Knative serving/eventing does (#857) 2020-05-26 23:58:59 -07:00
Markus Thömmes 4ba1cca91e
Update dependencies, pin k8s deps. (#855) 2020-05-26 00:39:49 -07:00
Daniel Helfand 4b3b971ae5
remove use of os.Exit (#851) 2020-05-25 22:12:48 -07:00
Markus Thömmes 739e63f835
Replace pkg/errors with stdlib errors. (#853)
* Replace pkg/errors with stdlib errors.

* Add changelog entry.

* Fix changelog.
2020-05-25 08:10:47 -07:00
coryrc 2df459577e
Use test-infra direct insertion method (#840)
Now available from knative/test-infra repo directly.
2020-05-25 06:57:47 -07:00
Daniel Helfand 9803cd6efd
fix panic for kn source ping describe with sink uri (#848) 2020-05-20 01:36:58 -07:00
Brian Tannous c7d28d5401
Update kn_completion for ZSH (#844)
Fixes: https://github.com/knative/client/issues/839
2020-05-19 03:09:56 -07:00
Daniel Helfand 0df54bc500
refactor kn service delete --all e2e test (#837) 2020-05-15 04:09:00 -07:00
Navid Shaikh 20e1a79b62
fix(e2e): Create next namespace for e2e if one exists (#835)
* fix(e2e): Create next namespace if one exists

 Do not error out if the namespace to run e2e into exists, try creating
 next one in row. Retry at 20 next namespaces, before erroring out.

* Tag plugin tests as !serving and !eventing

* Debug: Create a test namespace to see if its skipped

* Revert "Debug: Create a test namespace to see if its skipped"

This reverts commit 8b45fcef4d.

* Refactor file utils from e2e tests to test lib
2020-05-14 04:33:59 -07:00
Daniel Helfand 6f615c6595
add kn service delete --all (#836) 2020-05-14 03:51:59 -07:00
Matt Moore 9bbce80ffa
[master] Format markdown (#833)
Produced via:
  `prettier --write --prose-wrap=always $(find -name '*.md' | grep -v vendor | grep -v .github | grep -v docs/cmd/)`
/assign maximilien rhuss
/cc maximilien rhuss
2020-05-11 17:22:47 -07:00
Navid Shaikh e05c33447e
fix(e2e): Refactor e2e utils and resource actions (#832)
* fix(e2e): Refactor e2e utils and resource actions

 brings commonly re-used utilities into lib/test so they can be resused
 and e2e can be run selectively for eventing/serving.

* Refactor service and revision e2e test utils into test lib

* Docstrings for exported e2e test utils
2020-05-11 06:09:46 -07:00
Roland Huß 36716c3937
chore: Reworked CLI conventions and include more details (#831)
* chore: Reworked CLI conventions and include more details

* chore: Review changes

* Update conventions/cli.md

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* Update conventions/cli.md

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>

* add changes based on review comments

Co-authored-by: Navid Shaikh <nshaikh@redhat.com>
2020-05-09 08:33:45 -07:00