Commit Graph

4 Commits

Author SHA1 Message Date
dr.max 5dcc0f8641 added tests to `$kn service update ...` and removed required --image (#81)
* added tests for service update with variations of --requests/limits-cpu --requests/limits-memory
* made image optional on service update since that was not the case and image should be optional
2019-05-01 15:36:33 -07:00
dr.max dd4e2a917b Added support for limits and requests of CPU and memory (#78)
* Added support for limits and requests of CPU and memory. Examples:
1. kn service create mysvc --image dev.local/ns/image:latest --request-cpu 100m --requests-memory 64Mi
2. kn service create mysvc --image dev.local/ns/image:latest --limits-cpu 1000m --limits-memory 1024Mi

You can also include and/or omit the requests and limits. So the following should also work:
kn service create mysvc --image dev.local/ns/image:latest  --request-cpu 1000m --limits-memory 1024Mi

* Addressed comments about maintaining existing requests and limits and added more tests
* TestServiceCreateWithRequests
* TestServiceCreateWithLimits
* TestServiceCreateRequestsLimitsCPU
* TestServiceCreateRequestsLimitsMemory
* TestServiceCreateRequestsLimitsCPUMemory

* updating dependencies and formatting tests code
2019-04-25 20:20:29 -07:00
Kenjiro Nakayama 58e478bba4 Make image flag mandatory for service create command (#60)
`service create` command always requires and specify `--image` to run.

This patch changes:
- Add validation check if image is empty or not.
- Add image to `MarkFlagRequired()`.
- to add `--image IMAGE` in help message
2019-04-08 10:39:58 -07:00
Naomi Seyfer c3772a02ab `service create` beginning implementation (#47)
* Intermediate.

* Basic creation working

* Simplify

* Simple test passes

* Tests for env var updater, fix to bug found where wasnt getting a pointer

* Add some comments

* Fix env var quoting issues

* More comments from cppforlife

* Fix a couple copyrights
2019-04-03 22:33:56 -07:00