* 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>
* remove hardcoded kn for usage and error
* remove hardcoded kn for usage and error
* remove hardcoded kn for usage and error
* remove hardcoded kn for usage and error
* docs change
* Add support for multi-containers
* Update examples
* Fix UpdateContainers to match by name
* Add experimental note & tests
* Rename flag to --extra-containers
* Fix formatting
* Fix flag renaming leftovers
* Update pkg/kn/flags/podspec_test.go
Co-authored-by: Roland Huß <rhuss@redhat.com>
Co-authored-by: Roland Huß <rhuss@redhat.com>
* feat: Add subscription CRUD
- Add kn subscription command group and CRUDL sub-commands
- create/update uses following flag names for better alignment:
- --sink for subscriber
- --sink-reply for reply
- --sink-dead-letter for dead-letter-sink
- Add 'subscriptions' and 'sub' aliases
- Introduce shared library `knative.dev/client/lib/printing`
to print Sink object in describe output
* Set default channel type messaging.knative.dev/v1beta1:Channel
i.e. if no prefix is given to `--channel`, consider it of `Channel` type
* Update e2e tests
* Update channel flag description
* feat(channel): Manage knative eventing channels
- Support specifying the type of channel to create using --type.
- Default is to use messaging layer configuration for channels
- Channel type aliases via kn config and alias for InMemoryChannel
- User can now configure channel type aliases in kn config and specify
alias to GVK mappings for easy reference on CLI and refer with `--type` flag
- User can also use inbuilt alias 'imc' for InMemoryChannel
* Let channel reconcile, sleep for 5 secs after creation
* Add imcv1 and imcv1beta1 aliases
* Rename imcv1 alias to imc
* 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>
* feature(source cronjobs): Implementation of CronJobSource management
Contains create/delete/update/describe but not tests yet.
Still todo:
* Think how to provide a namespace for the sink
* Support for more sinks
* Synchronous mode for create & update
* Add list (or implement "source list")
* chore: Add a mock test for cronjob source
* addd missing license headers
* cosmetic changes
* chore(cronjobsource): Add tests
* fixup
* chore(cronjob source): Improved test coverage
* chore(cronjob source): some review polishing
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.
* 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.
* Check that every generated file has been regenerated for CI
* No color when not on a tty which is useful for build logs
* Always do updates when called without args
* Removed -u option and added -c for codegen only (dep update, docs gen, formatting, license check)
This puts all the console output to the command, where it belongs too.
One could add a ProgressHandler for more fine granular feedback (like suggested in #234) but for now this is not needed.
- Accepts an argument name for listing particular route
- Enables the machine readable output flags
- Updates docs for kn route command group
- Adds unit tests for route command group and route list
- Adds integration tests for route list in basic workflow test
- Updates tests and getting namespace
- Adds more unit tests for code in pkg/kn/commands/route/list_flags.go
- Adds route list command in smoke tests
- Updates vendor/modules.txt
- Clean up imports
- Addresses review comments
- replaces knative to Knative
- uses reflect.DeepEqual for slice comparison
- removes few code comments
- removes irrelevant tests modifications from the PR
* Remove unused `--config` option
Currently `--config` option in kn command is not used from anywhere.
This patch removes the option from the command.
* update auto gen files
* Update deps by hack/update-deps.sh
Also:
1. New docs for commands
* service get
* revision get
2. Removes auto generated docs tags
3. Auto run generated docs when building to pick up any command changes