Commit Graph

17 Commits

Author SHA1 Message Date
David Simansky e23b4d626e
Update k8s dependencies to v0.20.7 (#1344)
* Update k8s dependencies to v0.20.7

* Update vendor dir

* Fix license dir

* Remove commented code

* Update knative deps

* Use scheme to add known types for dynamic client

* Update go-licenses in build script
2021-06-17 07:42:22 -07:00
David Simansky 910d136563
Upgrade Eventing API from v1beta1 to v1 (#1284)
* Upgrade Eventing API from v1beta1 to v1

* Update vendor dir

* Fix channel ref parsing

* Remove leftover v1beta1 in docs & tests
2021-04-08 07:42:51 -07:00
Matej Vasek c62842355a
Use context.Context in API methods (#1274)
* Refactor: add ctx param to KnServingClient funs

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Passing ctx from knServingClient to ServingV1Interface

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Making wait function cancellable

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Test using background ctx

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Using cmd.Context() in pkg/kn/commands

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Handling SIGINT and SIGTERM

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Refactor: add ctx param to KnEventingClient funs

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Passing ctx from knServingClient to knative.dev interfaces

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Using cmd.Context() in pkg/kn/commands

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Test using background ctx

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup style

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Removing unnecessary dependency

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Refactor: add ctx param to KnChannelsClient funs

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Passing ctx from knServingClient to knative.dev interfaces

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Using cmd.Context() in pkg/kn/commands

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Refactor: add ctx param to KnSubscriptionsClient funs

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Passing ctx from subscriptionsClient to knative.dev interfaces

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Using cmd.Context() in pkg/kn/commands

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Refactor: add ctx param to KnSinkBindingClient funs

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Passing ctx from knBindingClient to knative.dev interfaces

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Using cmd.Context() in pkg/kn/commands

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Test using background ctx

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Refactor: add ctx param to KnDynamicClient funs

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Passing ctx from knDynamicClient to knative.dev interfaces

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Using cmd.Context() in pkg/kn/commands

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Test using background ctx

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Refactor: add ctx param to KnAPIServerSourcesClient funs

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Passing ctx from APIServerSourcesRecorder to knative.dev interfaces

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Using cmd.Context() in pkg/kn/commands

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Test using background ctx

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Refactor: add ctx param to KnContainerSourcesClient funs

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Passing ctx from containerSourcesClient to knative.dev interfaces

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Using cmd.Context() in pkg/kn/commands

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Test using background ctx

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Refactor: add ctx param to KnPingSourcesClient funs

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Passing ctx from pingSourcesClient to knative.dev interfaces

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Using cmd.Context() in pkg/kn/commands

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Test using background ctx

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Removing ctx param from RawClient()

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* ctx for watch/polling

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fix per review request

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Refactor: extract ctx

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Refactor: Namespace not requiring ctx

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* fixup

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Revert "Handling SIGINT and SIGTERM"

This reverts commit 9598646fda.

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Update CHANGELOG

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Add test for Wait()

Signed-off-by: Matej Vasek <mvasek@redhat.com>

* Add test for Wait()

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-03-26 09:23:20 -07:00
Markus Thömmes d647e44938
Upgrade a few assorted dependencies (#1220)
* Update spf13 deps

* Upgrade gotest.tools and correctly use versioned module

* Regenerate docs
2021-02-12 05:55:50 -08:00
Ville Aikas f15f2755d8
update to k8s 0.19.7, go v1.15, fix gnostic (#1206)
* update to k8s 0.19.7, go v1.15, fix gnostic

* oops, did not run ./hack/build.sh

* Fix unit tests that broke because of k8s 1.19 update

* Update asserting in test to adapt to new jsonpath output behaviour

Looks like that strings are quoted now in arrays.

* fix one more assert

Co-authored-by: Roland Huß <roland@ro14nd.de>
2021-01-28 04:35:31 -08:00
Ying Chun Guo 25b537b187
fix golangci-lint errors (#1068) 2020-10-18 23:20:58 -07:00
kaustubh d9d52346e7
feat: List available channel types (#1027)
* add channel list-types

* add kn channel list-types doc
2020-10-06 13:17:20 -07:00
Markus Thömmes 8f7088f0c0
Add linting config and fix issues. (#1001) 2020-09-11 05:41:00 -07:00
Navid Shaikh 0f95aa53c4
Set client custom GVK for source list for machine readable output (#980)
- Use custom GVK {Group: client.knative.dev, Version: v1alpha1, Kind: SourceList}
 - Source list may contain different source types CO and machine readable output (using -o)
   requires List object to have GVK set, since the list contains different types of source COs,
   we set a custom client GVK on it.

 Fixes #953
2020-08-18 02:08:13 -07:00
Navid Shaikh cc1b68e068
List inbuilt sources if CRD access is restricted (#948)
* List inbuilt sources if CRD access is restricted

 Fixes #947
 - Identify restricted access error
 - If server returns restricted access error, fallback to listing
   only eventing inbuilt sources using their GVKs.
 - List any inbuilt source (ApiServerSource) object and read the error
   to know if eventing is installed for `kn source list-types`.

* Fix golint warnings

* Remove unused imports

* Verify each built in source before listing source types

* Improve the check if sources are not installed in the cluster

* Update finding forbidden error

* Update finding errors

* Add unit tests for IsForbiddenError util

* Add unit tests

* Add tests for dynamic pkg library

* Add unit tests for case when no sources are installed

* Update test name
2020-08-04 04:42:28 -07:00
Roland Huß 2a42ee1a33
chore: Move from Eventing v1alpha1 to v1beta1 (#878) 2020-06-08 05:42:19 -07:00
Roland Huß df9278743b
chore: Update to Knative serving/eventing 0.14.0 (#810)
* chore: Update to Knative serving/eventing 0.14.0

and also move ApiServerSource to v1alpha2, adapting the option
(from "controller" to "labelSelector")

* fix go.sum

* chore: Update and fix tests

* chore: fix go.sum
2020-04-16 14:27:48 -07:00
Navid Shaikh ba7e14c807
feat(source): Add 'kn source list' (#666)
* feat(source): Add 'kn source list'

 Fixes #480
 - Add 'kn source list' listing the available sources COs
 - Use dynamic client to
       - find out available source types
       - find the COs in given namespace for each source type
 - Add --type flag to filter source list based on source type
 - Add unit tests
 - Add e2e tests
 - Add CHANGELOG entry

* Update group for ApiServerSource in tests

* Add kn duck source type for holding common eventing source fileds

 - Common infromation from sources are extracted into a struct
   for source list command output
 - Printer function picks the information from this struct object
   and doesn't know the details about extracting this info from multiple
   types of sources received
 - Group and Version for list is set to empty string and Kind to 'List',
   if printed a source list with multiple types of sources in machine readable
   format
 - Group, Version and Kind for list are kept intact if printed a source list
   with same type of source objects in machine readable format

* Update go.sum

* Add WithType builder for listing source

 - Separate the flags definition
 - WithType builder can be re-used to filter the source types
 - Add unit tests

* Update ApiServer source group to apiserversources.sources.knative.dev

* Fix typos and align

Co-authored-by: Roland Huß <roland@ro14nd.de>
2020-03-10 00:41:28 -07:00
Matt Moore c75cc2d958
Fix spelling errors (#712)
Produced via:
  `github.com/client9/misspell`
/assign maximilien rhuss
/cc maximilien rhuss
2020-03-09 08:33:28 -07: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
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
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