Commit Graph

9 Commits

Author SHA1 Message Date
Markus Thömmes 8f7088f0c0
Add linting config and fix issues. (#1001) 2020-09-11 05:41:00 -07:00
Roland Huß 490fe574cc
feat: Add plugin listing to "kn --help" (#929)
* feat: Add plugin listing to "kn --help"

This works on all levels. Test needs to be expanded still.

Fixes #266

* chore: Fix test

* Add test and ported #910 over.

* changelog update

* fix test

* Fix test

* fix integration tests

* fix test

* chore: Add some explanatory comments

* fix test
2020-07-14 13:38:33 -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
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 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
dr.max 395fc6c3b2
fix(#772) refactored / simplified parameters to KnResultCollector (#773)
* fix(#772) refactored / simplified parameters to KnResultCollector

* added Teardown() call in VersionTest
2020-04-08 02:18:01 -07:00
dr.max df78b8b40c
(refactor) address the e2e extract / refactor of issue #763 (#765)
* (refactor) address the e2e extract / refactor of issue #763

* various updates to address reviewers feedback

* renamed lib/test/integration to lib/test and package to test
2020-04-01 09:21:18 -07:00
Roland Huß a220a88534
chore(e2e): Refactor to better track errors (#667)
* chore(e2e): Refactor e2e to better track errors

* Collect results from various `kn` calls to
  provide the context
* Changed sub-Run() commands to t.Log() to reduce
  the log noise and get file + line information
  in the log output
* Removed any Fatal() calls to allows the test
  to properly finish
* Only output via t.Log() to get the output at the
  proper places and allow Prow to better pick
  up the test results.
* Most important: EMOJIS !! 🦆🦆🦆🦆🦆

* chore(e2e): Add more dumpers

* Moar debug
2020-02-16 23:52:10 -08:00
dr.max a0910db9a9 adds e2e tests for plugins (#591) 2020-01-09 01:25:54 -08:00