]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/cephadm: fix extra container/entrypoint args with spaces 49925/head
authorAdam King <adking@redhat.com>
Mon, 9 Jan 2023 19:50:12 +0000 (14:50 -0500)
committerAdam King <adking@redhat.com>
Mon, 27 Mar 2023 15:45:13 +0000 (11:45 -0400)
commit6d1b37ce3e68eb092c3dac3db45e955d32589cd9
tree6c74ae4e104adea0b631bce54881731f0eec9eeb
parent50fe1d3e3bdb4d90979af6c36ab05031fb5946f3
mgr/cephadm: fix extra container/entrypoint args with spaces

Fixes: https://tracker.ceph.com/issues/57338
Prior, doing extra container args like

- "--cpus"
- "2"

would work fine as the two args would be passed separately and
eventually placed in the final podman/docker run command
with a space between them. However, trying to do something like

- "--cpus 2"

instead would fail, as it would be translated to

--extra-container-args=--cpus 2

causing "2" to be considered its own arg, which cephadm
wouldn't know how to handle. Another way this can cause problems
is listed in the linked tracker. Either way, leaving the spaces
in the args was causing problems, and the simplest way to handle
it seems to be to just split on the original arg on the spaces
into multiple args

Signed-off-by: Adam King <adking@redhat.com>
(cherry picked from commit a161381ba816609b5041d2072e7e6cec39eaa753)
src/pybind/mgr/cephadm/serve.py
src/pybind/mgr/cephadm/tests/test_cephadm.py