]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mgr/cephadm: fix extra container/entrypoint args with spaces 48801/head
authorAdam King <adking@redhat.com>
Mon, 9 Jan 2023 19:50:12 +0000 (14:50 -0500)
committerAdam King <adking@redhat.com>
Mon, 9 Jan 2023 20:11:49 +0000 (15:11 -0500)
commita161381ba816609b5041d2072e7e6cec39eaa753
treecdb820d5c763e542089066c42337f29a12325a8e
parent8ee799e9cc0800fbedc8d9343aa3207bc9fd429e
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>
src/pybind/mgr/cephadm/serve.py
src/pybind/mgr/cephadm/tests/test_cephadm.py