Commit Graph

23 Commits

Author SHA1 Message Date
Gunjan Vyas 0ac405d4b5
Add timeout option to service create (#1643)
* Add timeout option to service create

* Changed unit tests to reflect the default timeout value

* Fixed timeout help message

* Added unit test for --timeout flag

* Moved --timeout flag to shared flags
2022-04-13 16:14:09 +00:00
David Simansky 2b1e77de20
Align autoscaling annotations in tests (#1531)
* Align autoscaling annotations in unit tests

* Fix code style

* Fix e2e tests
2021-11-26 05:34:51 -08:00
Roland Huß 03045c8195
Move `--autoscale-window` to `--scale-window` (#1489)
* Move `--autoscale-window` to `--scale-window`

and deprecate `--autoscale-window`

* regenerate docs

* fix issue that --scale-window was not picked up

* add some test

* add some additional test
2021-10-26 02:12:20 -07:00
Roland Huß a252d9b38d
Add an update timestamp to trigger the creation of a revision when needed. (#1364)
* Add a update timestamp anytime a new revision should be triggered. Previously client side revision names was this trigger but since we switched to server-side revision naming by default that didn't work anymore (and hasn't worked with server-side revision naming before, too).

Fixes #1318.

* fix e2e test

* add some unit tests

* Update error handling + added some tests

* fixed compile error in test

* lint fixes
2021-07-26 12:17:16 -07:00
Zbynek Roubalik a086cc9707
Add `env-value-from` flag & keep order of env vars in created/updated services (#1328)
* Add --env-value-from & preserve env var order

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* add e2e test for checking Service Env Vars

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* update changelog

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* refactor UpdateEnvVars()

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* apply review suggestions

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* fix typo

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>

* improve test cases names

Signed-off-by: Zbynek Roubalik <zroubali@redhat.com>
2021-06-29 01:48:13 -07:00
Markus Thömmes d647e44938
Upgrade a few assorted dependencies (#1220)
* Update spf13 deps

* Upgrade gotest.tools and correctly use versioned module

* Regenerate docs
2021-02-12 05:55:50 -08:00
David Simansky 8d3580a4b3
chore: Remove deprecated requests/limits flags (#1110)
* chore: Remove deprecated requests/limits flags

* chore: Add changelog entry
2020-11-11 05:52:59 -08:00
Roland Huß 8ca97c7920
Feature: "kn service apply" (#964)
* 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
2020-11-02 00:36:35 -08:00
Ying Chun Guo ed674822fe
Add ResolvePodSpec to podspec.go and move the related utilities to podspec_helper (#1024)
* moving utilities of handling podspec to podspec_helper

* address comments

* refactor code base

* change the input parameter from ccmd to flagset

* remove comments and add CHANGELOG
2020-10-27 10:45:33 -07:00
Arghya Sadhu 2c67eb9d7c
update error message when autoscaling annotation used in service (#1038) 2020-10-01 01:42:30 -07:00
Arghya Sadhu e8ae0e1537
adding annotation-service and annotation-revision to kn create/update (#1029) 2020-09-30 07:48:29 -07:00
David Simansky 719269e891
fix: Fix autoscaling annotations in Service metadata (#1021)
* fix: Fix autoscaling annotations in Service metadata

* chore: Add test cases

* fix: Rerun codegen

* chore: Split UpdateAnnotations to dedicated functions
2020-09-22 00:06:37 -07:00
Himanshu Ranjan 6c7fc7ca70
Add changes for --scale-init support (#990)
* 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
2020-09-15 02:51:41 -07:00
Navid Shaikh c1ab4ae863
Update flag names to --request and --limit (#872)
* 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
2020-06-03 04:04:18 -07:00
Navid Shaikh cdf6f29880
Add --requests and --limits resource flags (#859)
* 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
2020-05-28 01:45:59 -07:00
Murugappan Chetty 66173059fc
Add --user flag for service create and update (#679)
* add run as user flag #678

* add run as user flag #678

* add changelog for pr 679

* review comments  for pr 679

* review comments  for pr 679

* add test for config changes

* add user flag
2020-02-28 03:55:51 -08:00
David Simansky 8d2ecca7ae
Rename --async to --no-wait and deprecate it (#639)
* Rename --async to --no-wait and deprecate it

* Polish wording of deprecation warning message
2020-02-08 02:52:14 -08:00
Roland Huß 1b9a76bc31
feature(serving): Update API to serving.knative.dev/v1 (#640)
* feature(serving): Update API to serving.knative.dev/v1

Due to an issue with 0.12.0 (a missing constant) the update also includes an update
to the latest knative-serving  and knative-eventing dependencies from master
(as reflected in version.go)

Signed-off-by: Roland Huß <roland@ro14nd.de>

* fix(serving): Bogus import removed

* fix(serving): Add missing go.sum entry
2020-02-07 02:03:14 -08:00
Roland Huß b9dadf650e chore: Refactor mock testing (#548)
This makes it easier for other components (like eventing) to introduce an own
mock for their tests.
2019-12-11 10:27:49 -08:00
Ingwon Song 9d759ca6e4 Add support for envFrom and volumeMounts (#393)
* Add support for envFrom, volumeMounts, serviceAccountName, and imagePullPolicy

* Add comments for added functions

* Add test functions for --env-from

* Add test functions for --volume-mount

* Add test functions for --service-account-name and --image-pull-policy

* Add testing functions to cover the case "service update --env-from"

* Add test functions to cover the case "service update --volume-mount"

* Add missing test functions for config_changes.go

* Add testing functions for pkg/util/parsing_helper.go

* Fix a bug on a test case, caused by ignoring random orderedness of map

* Remove image-pull-policy because it is not supported by Knative

* Fix comments to clarify it as well as to fix a typo

* Remove service-account-name flags in order to submit it as a seperate PR

* Split --volume-mount flag into --volume-mount and --volume flags in order to enable multiple times mounting for the same volume

* Change the name of local variable to simplify

* Update docs

* Change the flag "--volume-mount" into "--mount", and fix it to make volume automatically when the config-map or secret is directley used. In addition, the test cases are changed to new unit test style. To keep the original orderedness given via flags, OrderedMap implementation is added as well

* Fix usage descriptions for the mount flag

* Factor out the name existence checking from createEnvFromSource

* Fix the usage description for --mount

* Sanitize a generated volume name
2019-11-06 04:15:03 -08: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
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