Closed zsuzhengdu closed 8 years ago
+1
Thanks for the contribution! Can you also provide a unit test for this?
Thanks. Do we care about validating the name of the limits? Is there a known set of valid limit names?
We do not need worry about validating the name of limits, 'docker' engine will do. If an invalid type is provided, following error will be threw out with input
ulimits:
kobe: 65535
File "/usr/lib/python2.7/site-packages/docker/api/container.py", line 368, in start
self._raise_for_status(res)
File "/usr/lib/python2.7/site-packages/docker/client.py", line 174, in _raise_for_status
raise errors.APIError(e, response, explanation=explanation)
APIError: 500 Server Error: Internal Server Error ("{"message":"oci runtime error: Wrong rlimit value: RLIMIT_KOBE"}")
Here is a list of 'supported' names. https://github.com/docker/docker/blob/1c32bed48c160342871d4f1470dd4d62b4baa9a5/vendor/src/github.com/docker/go-units/ulimit.go#L23
Thanks!
Thank you for your insightful code sample and comments!
PR for https://github.com/signalfx/maestro-ng/issues/161