Commit Graph

267 Commits

Author SHA1 Message Date
Navid Shaikh 73dfd21d21 chore: go mod tidy updates (#450)
Generated by
 ```
 go mod tidy -v
 ```

 Fixes #449
2019-10-16 12:57:15 -07:00
Roland Huß 6328a73c98 fix(service): Set default timeout for update to the same value as for create (#446)
Also, added accidentally removed seperator lines during create/update
2019-10-16 04:51:15 -07:00
Navid Shaikh 039cdfcc09 fix(e2e): Uses serving v0.8.1 in custom prow job (#452)
s/v0.7.1/v0.8.1
2019-10-16 03:16:15 -07:00
Ying Chun Guo a252829ceb fix a small error in verify-codegen.sh (#451) 2019-10-16 02:39:15 -07:00
Navid Shaikh 419678a4b8 Updates YAML transitive dependency to v2.2.4 (#448)
As per title, just to make sure we're not vulnerable to CVE-2019-11253.
 See kubernetes/kubernetes#83253.
2019-10-15 14:36:15 -07:00
Roland Huß 53125bcbdb chore: Some minor printout fixes (#442)
* chore: Some minor printout fixes

* test fixes
2019-10-11 09:51:31 -07:00
Roland Huß a2d1ef7d83 chore(service): Improvements for waiting on service readiness (#431)
* Increased default timeout to 600s. This timeout will be triggered
  only when the Ready condition stays in UNKNOWN for that long. If its
  True or False then the command will return anyway sooner.
  So it makes sense to go for a much longer timeout than 60s
* Enhanced output to indicate the progress

This change needs some updates to the API and introduces a 'MessageCallback'
type which is calle for each intermediate event with the "Ready" condition message.
2019-10-10 06:06:06 -07:00
Joan Edwards e386b4e2ae Add navigation for management section (#436)
* Add navigation for management section

* Update management.md

* Update management.md
2019-10-08 07:47:36 -07:00
Joan Edwards 9467b25331 Update README.md (#437) 2019-10-08 06:35:35 -07:00
Joan Edwards 8ec74e686a Minor grammar corrections (#435) 2019-10-08 05:00:40 -07:00
Roland Huß e67d207d3b chore(build.sh) Add indicator in watch mode after successful compilation (#432)
* chore(build.sh) Add indicator in watch mode after successful compilation

* chore(build): Update changelog
2019-10-08 04:34:38 -07:00
Roland Huß 80f7f341bb chore(test): Add a ContainsAllIgnoreCase helper method (#433) 2019-10-08 03:40:40 -07:00
Navid Shaikh 2f7fa6a7c2 feat(annotations): Adds annotation flag for service create and update (#422)
* feat(annotations): Adds annotation flag for service create and update

  - Adds specified annotations to service object meta and revision template meta
  - Adds --annotation / -a flag to service create and update options
  - User can specify '-' at the end of the annotation key to remove an annotation
  - Adds unit and e2e tests
  - Updates docs and changelog accordingly

* Adds example for service create with annotation

* Adds mock unit tests for service update with annotations

* Removes the short hand -a for annotation flag
2019-10-04 06:40:05 -07:00
dr.max d543b0e5a3 fixes(#414): change plugins config to use - instead of camel case (#428)
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.
2019-10-04 00:48:08 -07:00
Naomi Seyfer b27e366dcb Service describe: information about revision status, tags, latest [created, ready] revisions, and latest traffic (#379)
* 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
2019-10-03 11:33:08 -07:00
Navid Shaikh e73a1c0348 fix(docs): Fixes kn nightly build link for Mac OS X (#427)
Fixes #425
 - Updates the link to https://storage.googleapis.com/knative-nightly/client/latest/kn-darwin-amd64
2019-10-01 07:11:08 -07:00
dr.max dba0d11320 Fixes issue #338 by adding documentation for the Kn config (#411) 2019-10-01 02:44:08 -07:00
Joan Edwards ffbf6841c2 Restructure Docs (#421) 2019-09-30 07:33:45 -07:00
Ying Chun Guo 7a813be35e update the description of flag namespace (#419) 2019-09-30 01:12:51 -07:00
Roland Huß 6ffef8dd88 refactor(knclient): Moved KnClient -> KnServingClient (#420)
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.
2019-09-28 09:21:45 -07:00
Ingwon Song 14ec594e56 Add --service-account-name flag (#401)
* 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
2019-09-23 04:45:13 -07:00
Toshinori Sugita 43f8386b82 fix analyzer warnings (#412)
* remove unused codes (structcheck)(varcheck)

* add error handling (errcheck)

* add error handling (ineffassign)

* fix lint errors (golint)
2019-09-23 03:03:12 -07:00
Tsubasa Nagasawa 94bb1cf8db Use sets utility for saving updated env vars (#409) 2019-09-17 07:53:46 -07:00
Tsubasa Nagasawa b1f5e7d6fe Update release note section in PR template (#410)
Remove unused release note section in PR template and add instruction for updating CHANGELOG.
2019-09-16 06:18:40 -07:00
Roland Huß 34fcd89bcd chore(build): Tuned cross compiling a bit (#405)
* 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)
2019-09-12 07:39:32 -07:00
Tsubasa Nagasawa 9b52fc8345 Update EnvVars in alphabetical order of Env key name (#389) 2019-09-12 01:12:32 -07:00
Gong Zhang a607b16b0c Rename go files under command group dir (#245)
- Files under service dir
- Files under revision dir
- Files under plugin dir

[issue 229](https://github.com/knative/client/issues/229)
2019-09-06 00:13:03 -07:00
Gong Zhang b649b72694 Fill up test cases for files with low coverage (#399)
To get the test pass for https://github.com/knative/client/pull/245,
need to fill up test cases for files with low code coverage
2019-09-05 03:33:04 -07:00
Navid Shaikh 2985e550cd docs: Adds documentation for traffic splitting support in kn (#331)
- 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
2019-09-03 13:40:01 -07:00
Komal Dhull 679096194a Added --no-headers flag for resource listing (#262) 2019-09-03 00:31:00 -07:00
Naomi Seyfer 0ff537ad98 By default, set `Image` to the image of the prev. revision by digest (#373)
* 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
2019-08-27 11:42:40 -07:00
Navid Shaikh 10f981ccaa Ensures kn cross platform build works in presubmit tests (#385)
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
2019-08-26 10:59:17 -07:00
Toshinori Sugita 699ac5e7cb fix lint errors (#388)
* 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
2019-08-24 22:46:13 -07:00
makocchi 04a55b27f2 Remove namespace from args (#386) 2019-08-22 18:00:12 -07:00
Roland Huß 9625b5f4c5 chore(plugins, services, routes): Aligned "Not found" messages (#359)
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`.
2019-08-22 00:23:32 -07:00
Tsubasa Nagasawa d0dc3b75f3 feature(service list): Print NAMESPACE column as the first column when --all-namespaces is specified (#366)
* 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
2019-08-21 23:57:33 -07:00
Navid Shaikh d6c798ad65 Adds option in hack/build.sh to build cross platform binaries (#371)
- 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
2019-08-21 16:16:33 -07:00
Naomi Seyfer 223ff5316a Pass on args to e2e tests for local script (#382) 2019-08-21 15:46:33 -07:00
Adam Harwayne 40631a6e97 Retain the request body when logging HTTP. (#378)
* Retain the request body when logging HTTP.

* hack/build.sh -u

* Add a unit test.

* Unit test redacted headers.
2019-08-21 12:23:33 -07:00
Leonardo Rossetti f97f305fed check if status detail is nil (#380) 2019-08-20 02:24:06 -07:00
Naomi Seyfer 7b90959033 Fix json path to latest revision in e2e tests to something reliable (#376) 2019-08-19 22:31:04 -07:00
Navid Shaikh dccaf36611 kn version command to list supported serving versions and APIs (#370)
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

 ```
2019-08-19 15:25:59 -07:00
dr.max e36089f260 Add reference to plugin in README.md (#363)
* Add reference to plugin in README.md

Working on various plugins docs. This is first of three PRs.

* typo and clarification

* fix links
2019-08-15 23:16:09 -07:00
Naomi Seyfer 25c726453e Update serving dependency to 0.8; change all import paths (#368)
* 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
2019-08-15 18:09:08 -07:00
Naomi Seyfer b707702973 Always create in new format rather than old (#361)
* Always create in new format rather than old

* Rejigger tests and make them independent of filesytem

* Fix test on mergeout
2019-08-15 16:01:07 -07:00
Navid Shaikh 54d024f1bd Portable plugin executable check for Windows platform (#367)
* 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.
2019-08-15 15:28:07 -07:00
Navid Shaikh 746dacc47c feature(service): Implements traffic splitting and tagging targets (#345)
- 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
2019-08-15 10:56:08 -07:00
Leonardo Rossetti c4e8d5a964 improved create service error message (#312)
* improved create service error message

* error pkg

* revisions error handling

* adding license

* project rebuild

* unit test improvements

* build updates
2019-08-14 17:10:08 -07:00
Naomi Seyfer ffe80b9f87 Specify names on service update and generate names client-side. (#282)
* 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.
2019-08-14 15:31:07 -07:00
Naomi Seyfer dbb63d4542 Clean up bool flags a little (#362) 2019-08-14 13:02:08 -07:00