Commit Graph

486 Commits

Author SHA1 Message Date
Navid Shaikh 2e1a863815
Revisit sink prefixes: Support only 'ksvc' prefix and drop 'svc', 'service' support for knative service (#896)
* Update description for sink flag

 - Add examples for broker, service and URI
 - Add note about default prefix and service alias

* Update the sink flag description

* Update cli conventions doc

* Update the sink prefixes mapping

 - 'ksvc' prefix for knative services
 -  Remove 'svc' or 'service' prefixes mapping for knative services

* Hint in err msg to use 'ksvc' if used prefixes 'svc' or 'service'

* Update CHANGELOG

* Update source list e2e tests to refer ksvc prefix

* Update sink flag description
2020-07-14 00:46:18 -07:00
Murugappan Chetty 226e605d40
Update CHANGELOG and error for port flag parsing (#926)
* error message change for #912

* add change log
2020-07-12 12:48:08 -07:00
kaustubh ad145a89d8
Add E2E test cases for "kn source list". (#924)
* add invalid filter test case

* add invalid test case

* add source list test, output yaml format

* fix sourcelist failed test case
2020-07-11 06:21:37 -07:00
Mike Petersen e1c48e6f7a
Added the option to use --scale for setting MinScale and MaxScale to the same value (#914)
* Added the option to use --scale for setting MinScale and MaxScale to the
same value

* Updated service create/update to resolve test issues

* Removed scale from the annotation section - there isn't a scale
annotation

* Renamed test service name so that it doesn't match a previous test

* Addressed most issues/changes

* Added tests for multiple flags being used at the same time

* Cleaned up the update tests

* Added negative value tests and cleaned up tests in create_test.go
2020-07-11 02:33:37 -07:00
David Simansky 41e49b98c5
feat: Add --filename flag to service create command (#913)
* feat: Add --file flag to service create cmd

* fix: Fix linter warnings

* fix: Remove unecessary changes

* fix: Reflect review feedback

* fix: Change flag --file to -f,--filename

* fix: Reflect review feedback

* fix: Move test cleanup to correct place

* fix: Refactor name param restrictions

* fix: Fix flag name string in func
2020-07-11 02:03:37 -07:00
Navid Shaikh f91fb57f9a
kn v0.16.0 release prep (#922)
* Update unit test for invalid concurrency target value

* Vendor v0.16.0 eventing and serving

* Commit the LICENSES generated by hack/update-deps.sh

* Spare third_party dir from license check in hack/build.sh

* Update eventing and serving version for 'kn version'

* Use DeprecatedInjectionAnnotation key for backward compatibility

  Fixes #918
  Use DeprecatedInjectionAnnotation, i.e. "knative-eventing-injection"
  for reconciling broker via namespace labeling and trigger annotations.

  From eventing v0.16.0 release, this key is changed to "eventing.knative.dev/injection"
  however, older eventing installation wont recognize it. So we continue
  using the deprecated key until the sugar-controller would support reconciling
  on either keys.

* Fix(kn version): Display eventing.knative.dev at v1beta1 version

 We've been showing 'v1alpha1' in kn version while we actually
 vendor and refer v1beta1 for eventing.knative.dev

* chore(e2e): Run tests against serving/eventing v0.16.0 release

* Update test for concurrency-target to expect new error message

 the new error message for incorrect concurrency-target value contains "should be at least 0.01"

* Setup sugar-controller for released eventing version setup

 - reuse knative_setup util from common lib for latest-release CI setup

* Fix typo in YAML URL and add subheader for sugar-controller install
2020-07-10 10:41:19 -07:00
Murugappan Chetty b04d115db9
add port name (#915)
* add port name

* add port name

* review comments

* review comments

* add unit tests for port changes

* review comments for port spec changes
2020-07-10 07:53:18 -07:00
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