]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/cephadm: fix extra container/entrypoint args with spaces 49851/head
authorAdam King <adking@redhat.com>
Mon, 9 Jan 2023 19:50:12 +0000 (14:50 -0500)
committerAdam King <adking@redhat.com>
Fri, 3 Mar 2023 15:10:55 +0000 (10:10 -0500)
commit2ccad377d2ba6bec12b8e390de004984712eb48e
tree836d10837a0b695fec41bb4bfb5b8e6883344ca2
parent0980c8318e678131c9b9fef629d1b3670efa3696
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