This solves 414 by adopting new format for config keys and thereby
bypassing the need for case sensitivity in Viper. Also changed
`lookupPluginsInPath` key to `lookup-plugins` and also same for the
persistent flag. The PATH part is implied and can be read from
help.
* Change symbols, add latest and latest ready
* More info on what is latest and tags. Filter annotations and labels.
* Make current tests pass
* More tests
* No longer require Annotations in test
* Add error
* Adjust tests to match adjusted output
* Respond to review comments
* one more
* Fix double printing of revisions + test for it
* Differentiate between latest traffic and latest ready w/o that being reason for traffic
* Re-build with go 1.12
* Rebased
* Limit non-verbose output to error and image
* Fix tests for new format
* refactor(plugins): Improved and simplified verifier and plugin list
* Added proper executable check for current user
* Refactor plugin_list to make it more straightforward
* Seperate errors and warnings
* Don't return an error when no plugin is installed and `plugin list` is called
* Simplified tests
* Check assumption that a prefix is given in verify()
* fix(plugins): Fixed broken homedir expansion
* fix(plugin): Adapted to proper permission handling
E.g. if u-x, g+x and the user has the group of the file, but is also owner of the file then he is not allowed to execute the file.
* test(plugins): Added checks for the execution check for plugins
* chore(plugins): optimized tests to reflect the real unix behaviour
* chore(plugins): Moved plugin seenMap to top-level verify method.
Also, allow symlinks without warnings.
* refactor(plugins): Split up some methods in plugin_verifier to make them shorter
* fix: Tuned `plugin list` for better handling when no plugin directory exists
* Add --log-http option
* Oh yeah build it and change docs and stuff
* And some test
* Actually test the thing I meant to
* There was a way to remove the downcast
* Test for http transport
* Some deps
* Elide sensitive headers from logging
* Test for eliding errors
* Feedback from CL
This version contains the following:
1. wraps the main root Kn command to support plugin
2. plugins are any executable in kn's config new pluginDir
variable which defaults to $PATH
3. plugins must have name kn-*
4. 'kn plugin list' sub-command to list found kn plugins
5. skips any kn plugins found with name that match core
commands, e.g., kn-service would be ignored
6. can execute any valid kn plugins found, e.g.,
`kn valid` where the plugin file `kn-valid` is in path
specified in 2.
7. unit tests (using gotest.tools)
And is missing:
1. integration tests
2. plugin install command
3. plugin repository command
4. plugin / Knative server version negotiation
5. anything else we agree on in plugin req doc
I plan to create issues for the things missing so we don't
end up with an even bigger PR. It's already big as is but is a
good MVP as per plugins requirement doc.