* cli options to enable kubernetes user and group impersonation
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
* cli option to enable uid impersonation
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
* Added flag to configure wait-window between intermediate errors during service create
* Added waitconfig struct
* Moved --wait-window flag to shared flags
* 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>
* 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>
* Make wait, no-wait and async flags per bool var CLI convention
Fixes#800
- Deprecated bool vars can be supported for CLI convention
- Bind --async flag value to --no-wait
- Only one flag among [wait, no-wait, async] can be provided, else raise an error
* Simplify conditionals
* Add unit tests for deprecated flag async
* Fix a typo
* Remove the delete propagation flag
In it's current state it now takes me about 25 seconds for the `kn delete`
to complete. Before https://github.com/knative/client/pull/682 it used to be
almost immediate. This is because we now pass in the
`DeletePropagationBackground` flag. I believe this is a mistake, not only
because of the 20+ seconds of additional time to delete things, but IMO
the CLI should talk to the server in the same way regardless of the --wait
flag. That flag should just be a CLI thing to indicate if the user wants the CLI
to wait for the server to complete but not HOW the server should do the delete.
Signed-off-by: Doug Davis <dug@us.ibm.com>
* try just tweaking the --no-wait flag
Signed-off-by: Doug Davis <dug@us.ibm.com>
* 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.
* Adds kn revision delete command
* Adds unit tests for revision delete command
* Adds integration tests for revision delete command
Added revision delete command tests in new workflow namely
TestRevisionWorkflow.
* Removes extra line and renames an import alias
* Adds 10 seconds sleep between service create and revision delete
Also adds check for 'No resources found' while grabbing revision name.
* Clean up imports
* Removes the pause after service create
* Updates testing output strings in unit and e2e
* Updates post goimports on hack and test dirs