This is in preparation of introducting eventing and makes sense anyway.
Also, the GVK update handling has been moved to "util" so that it then
can be also reused by eventing.
* Add --service-account-name flag
* Change the flag --service-account-name to --service-account, and change its default value from "-" to an empty string. In addition, CHANGELOG.adoc is changed.
* Update docs with ./hack/build.sh
* Renamed to --build-cross to --all (as we are not building a cross but all binaries. Could be renamed to --all-bin to be more clear)
* Fixed inclusion of external build-flags.sh script (which was broken when used build.sh with a symbolic label)
* Moved cross compiling to the end (to not interfer with --fast or --codegen)
* Aligned labels (to be short and concise)
- Add summary about operations, their usage and examples
- Flags precendence explained
- Summary column explaining if repetition is allowed or not
- Example of different scenarios
- Add case where tagOfOneTarget==revisionOfAnotherTarget, prefrence goes to tagOfOneTarget
as Tags are unique while revions in a traffic block aren't.
- Updating tag requires using `--untag` flag
- Update doc to mention the tag update operation and example
- Add notes about
- assigning multiple tags for same revision
- creating a new target in traffic if same revision is tagged with new tag
- Update CHANGELOG
- Add an example per sub-section of flag description
* Option to freeze revision to digest
* Tests pass. Checkpoint.
* Tests for env now check pinning to digest
* Bool flag using convention. Tweak usage.
* Describing the image carefully using the annotation and digest
* lint
* Test matrix of locking to digest behaviors
* Expose both flags, and rewrite help text again
* Unit tests.
* Removed unsed method
* Add tests for getting base revision
* Make tests actually test stuff better
* Make tests actually test stuff better
* A mergeout killed a returning of error. Restore it
* Help text again
Fixes#364
- Ensure kn cross platform build works in pre-submit tests
- Run ./hack/build.sh -x after running existing pre-submit tests
- defines a function post_build_tests to invoke cross platform builds
- post_build_tests will be run by test-infra after build tests are compelete
* fix typo (misspell)
* ineffectual assignment to err (ineffassign)
* if block ends with a return statement, so drop this else and outdent its block (golint)
* should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
* struct field LogHttp should be LogHTTP (golint)
* fix last typo
For the sake of consistency with out own service commands and for kubectl,
`kn plugin list` should print:
```
No plugins found.
```
`kn service list` should print:
```
No services found.
```
and not `No resources found.` like it does now.
Same for `kn routes list`.
* Make `kn service list --all-namespace` print namespace column
`kn service list` should print NAMESPACE column when specifying `--all-namespace` option, which follows the kubectl convention.
* Put services in default namespace at the top of the list
* Switch output of column definitions by priority field
A priority field is handled as follows:
- priority 0: print namespace column
- priority 1: print default columns
- priority 2: print additional columns for wide option
* Don't use AddFlags to bind all namespaces flag
* Update CHANGELOG
* Remove commented codes
* Fix import path
* Clean up
* Remove unnecessary return
* Swap the order of records
- Use `./hack/build.sh -x` or `./hack/build.sh --build-cross`
- Doesn't touch any of the existing flow, providing these options will build binaries and exit
Fixes#369
- Replace `Dependencies:` with `Support:`
- Add list of supported Serving versions kn can work with
- Add list of supported Serving APIs kn can work with
```
✗ ./kn version
Version: v20190816-local-e36089f-dirty
Build Date: 2019-08-16 13:08:26
Git Revision: e36089f
Support:
- Serving: v0.8.0 v0.7.1
- API(s): v1alpha1
```
* Update serving to 0.8. Try building.
* Find the right serving version
* Change our own import path to knative.dev to match
* Remove dependency on old version of client
* Update yaml template
* Add sleep to test to deal with race
* fix merge conflict
* Update vendor modules
* Portable plugin executable check for Windows platform
builds Windows and non-Windows platform plugin verifier separately
* Removes redundant build tag and file suffix, uses file suffix
As we'll need either to mention, which file compiles for which
platform.
- Add e2e tests
- Use '=' for traffic and tag assignment instead of ':'
- Use --tag and --untag flags for tagging traffic targets
- Use --traffic flag for setting traffic portions
- Allow --traffic portion to either take revisionName or tagName
- Uses @latest identifier for referencing latest revision of service
- Dont throw error if requested revision=tag pair is same
- Support having multiple tags for a revision
- creates a new target in traffic block if revision present in traffic block with new tag requested
- creates N new targets in traffic block if revision absent in traffic block with Nxnew tags requested
- Ensure updating tag of @latest requires --untag flag
- streamline updating tag for latestReadyRevision
- adds respective tests
- adds tests for ensuring given traffic sum to 100 on CLI and fail fast
- Add note about preference of order in case where tagOfOneRevision == revisionOfAnother,
first tags are checked and assigned traffic if any, as tags are supposed to be
unique in traffic block and should be referenced in such scenario.
- Remove the examples from flag description, moves it to service update command example section
- Pass only traffic block to compute trffic, makes it better to consume.
- Cover more error cases for invalid value format for assignments, covers a=b=c, a=, =b, or variants of them
- Separate and improves the error messages
- Add unit tests for traffic computing
- Add sanity checks in dedicated function verifyInputSanity
- traffic perents should sum to 100
- individual percent should be in 0-100
- repetition of @latest or tagName or revisionRef is disallowed
- Verify traffic percents sum to 100 on client side and fail fast
- Add e2e tests for traffic splitting
- create and update service, assign tags and set traffic to make an existing state
- run the scenario on existing state of service
- form the desired state traffic block
- extract the traffic block and form the traffic block struct actual state
- assert.DeepEqual actual and desired traffic blocks
- Use logic to generate service name in the same way as namespace, use different service name per test case
- Run e2e test for traffic splitting in parallel
- Use timeout duration of 30m for e2e tests, use timeout parameter for go_test_e2e library function
- Use tagName in flag description of --untag, avoiding conflict with --tag flag
- Update CHANGELOG
* Groundwork for naming revisions automatically and deliberately
* Tests for name updates
* Add godoc comments
* Changelog entry for naming flags
* Error when trying to BYO revision name to an old-format service
* fix tests again
* Template the names
* Polsh, remove unused flags, generate helptext, add better helptext
* Decapitalize error msg
* Respond to Roland comments
* Forgot to add test file
* Be a good citizen, add more tests, try to get coverage happy.
* true dat
* Re-add implicit service prefix if one was not added.
* Allow boolean flags in the matched `--foo` and `--no-foo` format.
* test for it
* Godoc for new functions
* Copyright date update
* Disallow user from setting either flag to false explicitly. Moar tests, for this & other cases
* Apply suggestions from code review
Co-Authored-By: Roland Huß <rhuss@redhat.com>
* Fixup
* Add support for service labels with --label or -l
* Add tests
* Fix typo
* Move MapToArray helper method to separate file
* Allow unsetting labels by passing empty value
* Fix test
* Add test case for label removal
* Wrap error message with flag
* Update docs to include --label
* Update labels on both services and revisions
* Add some test cases around weirder user input
* Change unset behavior and allow setting empty env and label
* Update docs for new unset behavior
* Make single keys to map to empty values
* Move helper to util
* Use assert.DeepEqual
* Use new mock test + check both service and revision
* Use new method and correct year
Fixed:
```
$ ./kn plugin list --lookup-plugins-in-path
panic: runtime error: index out of range
goroutine 1 [running]:
github.com/knative/client/pkg/kn/core.extractKnPluginFlags(0xc00003c0c0, 0x4, 0x4, 0xc0002be280, 0xc000000180, 0xc0002ba180, 0xc0000de670, 0xc000117f68)
/root/go/src/knative.dev/client/pkg/kn/core/root.go:222 +0x666
github.com/knative/client/pkg/kn/core.NewDefaultKnCommand(0xc000000000)
/root/go/src/knative.dev/client/pkg/kn/core/root.go:46 +0x79
main.main()
/root/go/src/knative.dev/client/cmd/kn/main.go:33 +0x46
```
While in there I fixed it so that we only look for --flag at the start
of the arg, and handle the --flag, --flag=, and --flag=xxx cases.
If there's --flagX we skip it because it's some other flag and not one
of interest to us.
Also, fixed some error processing that seemed a bit off.
Signed-off-by: Doug Davis <dug@us.ibm.com>
* Add support for -A variant of --all-namespaces
-A is my newest favorite kubectl flag, it's so much easier/faster to type
than --all-namespaces. kn users should benefit from it too!
Signed-off-by: Doug Davis <dug@us.ibm.com>
* tweak tests
Signed-off-by: Doug Davis <dug@us.ibm.com>
* 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
* feature(service describe): Output of service details
`kn service show` mimics `kubectl describe <sth>` as that it output detail information in human readable output.
A future extension should add machine readable output with `-o` to export
a single object in json/yaml (that is missing from `kn service list`)
This command shows information about the service itself, but also a summary about the associated revisions.
It also knows about scaling and concurrency options.
Options:
`--details` : Print more information. By default only are shorter summary is shown
* chore: Cleanup up and refreshed dependencies
* fix(service describe): Integration test fix (revert "show" to "describe")
* fix: go.sum
* fix go.sum
* feature(service describe): Add printing of resources (requests/limits) + machine readable output with -o
* chore(service describe): Simplified digest handling
* chore(service describe): Sort maps by key when printed
* chore: Adapt mock framework
* chore(service describe): Test fixes
* chore: Added some tests
* more tests
* test: Moar tests
* chore: Even moar tests
* more, more tests
* changelog update
* fix(service describe): golint fixes
* List revisions sorted by generation order
We use a configuration generation as a sort key, which is obtained from a label on configuration resource.
* Change column name from order to generation
* Fix revision sorting issue
* Fix revision e2e test
* Just sort by name if invalid type of generation found
* Update CHANGELOG
* 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