* feat: "kn service apply"
This commit introduces a client-side apply with a plain JsonPatchMerge. This is more limited than a StrategicPatchMerg as it does not allow to merge lists (they are just overwritten). Also is not a real 3-way merger that would lead to a conflict when both the, the server-side and the provide update overlapp in fields that updated, compared to the shared original configuration. This is a problem of JsonThreeWayMerger itself, as pointed out in https://github.com/kubernetes/kubernetes/pull/40666#pullrequestreview-502804243.
This limitation is shared with kubectl, which suffers from the same issue if using `kubectl apply` with a custom resource (i.e. with everything that has schema that is not registered within kubectl).
Tests are missing, too, but will come soon
* chore: Add tests for 'kn apply'
* refactor: Removed PatchService from pulic API interface
* fix: Display of service URL at the end, when no changes apply
* chore: Add initial E2E test
* chore: Implemented review suggestions
* More tests
* Example for kn service apply
* Remove commented-out code
* lint fixes
* fix formatting of kn service apply doc
* fixing go.sum
* chore: Update deps
* 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
* Add changes for --scale-init support
* Added test cases
* Add test case in e2e tests
* minor fix
* Test case failure fix
* Incorporated review comments
* Add service update test cases
* Incorporate review comments
* 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
* chore: Add support for internal plugins
* added test for internal plugin lookup
* add changelog entry
* fix formatting
* update to latest changes on main
* Added more tests + some docs
* formatting fix
* moved to proper injection label for setting up the broker in integration test
* Update description for sink flag
- Add examples for broker, service and URI
- Add note about default prefix and service alias
* Update the sink flag description
* Update cli conventions doc
* Update the sink prefixes mapping
- 'ksvc' prefix for knative services
- Remove 'svc' or 'service' prefixes mapping for knative services
* Hint in err msg to use 'ksvc' if used prefixes 'svc' or 'service'
* Update CHANGELOG
* Update source list e2e tests to refer ksvc prefix
* Update sink flag description
* Added the option to use --scale for setting MinScale and MaxScale to the
same value
* Updated service create/update to resolve test issues
* Removed scale from the annotation section - there isn't a scale
annotation
* Renamed test service name so that it doesn't match a previous test
* Addressed most issues/changes
* Added tests for multiple flags being used at the same time
* Cleaned up the update tests
* Added negative value tests and cleaned up tests in create_test.go
* feat: Add --file flag to service create cmd
* fix: Fix linter warnings
* fix: Remove unecessary changes
* fix: Reflect review feedback
* fix: Change flag --file to -f,--filename
* fix: Reflect review feedback
* fix: Move test cleanup to correct place
* fix: Refactor name param restrictions
* fix: Fix flag name string in func
* Add support for service url in svc describe output
* Add changes in CHANGELOG.adoc
* Update CHANGELOG.adoc
Co-authored-by: Matt Moore <mattmoor@vmware.com>
* Add url as output format in kn service describe --help command
* Build locally and autogenerated doc
* Change service describe help message for consistency
Co-authored-by: Matt Moore <mattmoor@vmware.com>
* add kn export type
* add kn export type
* add kn export type
* Update pkg/apis/client/register.go
Co-authored-by: Matt Moore <mattmoor@vmware.com>
* e2e test for kn export type
* e2e test for kn export type
* add new type for kn export
* rebase
* rebase
Co-authored-by: Roland Huß <rhuss@redhat.com>
Co-authored-by: Matt Moore <mattmoor@vmware.com>
Co-authored-by: Roland Huß <roland@ro14nd.de>
* 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>
* Update flag names to --request and --limit
- Use singular flag names and support comma separated or repeated flag values
- Update tests and docs
* Update CHANGELOG
* Update the flag description and examples
* Remove release 0.15.0 header from CHANGELOG
* SinkBinding: Support update and remove of cloud events extensions
- Add unit tests
- Update flag description
- Update parsing utilities for map
* APIServer: Add, update and remove cloud events extensions
- Add --ce-override flag
- Add unit tests
* PingSource: Add, update and remove cloud events extensions
- Add --ce-override flag
- Add unit tests
* Update CHANGELOG
* Update binding builder method name to CloudEventOverrides
* Fix lint warnings
* Add ceoverrides to unit test objects
* Update PR number in CHANGELOG
* Show ce-override extensions in describe output
* Add --requests and --limits resource flags
Fixes#490
- Add deprecation message for --requests-cpu, --requests-memory,
--limits-cpu and --limits-memory flag usage.
- Add error message if new and deprecated, requests and limits flags
are used together.
* Add resources requests and limits example for service create
* Add mock style unit tests
* Update existing unit tests for deprecated flags
* Add integration tests
* Add CHANGELOG entry
* Fix lint warnings
* Add unit tests for resource flags
* Fix typo for service name in e2e tests
* Refactor resource validation utility into test lib
* Remove commented out code
* Add references about managing resources and GPU in example
* Update image references in examples
* refactor kn service export to export revisions
* refactor kn service export to export revisions
* refactor kn service export to export revisions
* refactor kn service export to export revisions
* kn service export refactor
* kn service export refactor
* kn service export refactor
* kn service export refactor
* review changes for #819
* 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
* 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
I find that I'm using annotations more and more and since `-a`
wasn't being used I decided we should save people from typing too much
Signed-off-by: Doug Davis <dug@us.ibm.com>
* 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>