From: John Mulligan Date: Wed, 21 May 2025 21:46:40 +0000 (-0400) Subject: dashboard: fix the workaround for unpacking node sources X-Git-Tag: testing/wip-jcollin-testing-20250827.090412-reef~5^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bc2a5652c7894692ee2bea99ea1003eb85c60161;p=ceph-ci.git dashboard: fix the workaround for unpacking node sources My previous workaround in the dashboard for the unpacking of non-root own tarball as the fake root of a container did not work because of the strange quoting/escaping behavior of cmake (it tried to run `id -u` as a single command, not a command and an argument). Use single quoted string and old school backticks to work around this issue. Fixes: 24dbfb5da4813c6588f9cd199b9f527bb67f1e88 Signed-off-by: John Mulligan (cherry picked from commit 3a36180a373d91adcf9726660204f0cc1dcecba3) --- diff --git a/src/pybind/mgr/dashboard/frontend/CMakeLists.txt b/src/pybind/mgr/dashboard/frontend/CMakeLists.txt index 4ec009712ff..6c85e50716a 100644 --- a/src/pybind/mgr/dashboard/frontend/CMakeLists.txt +++ b/src/pybind/mgr/dashboard/frontend/CMakeLists.txt @@ -69,7 +69,7 @@ else(WITH_SYSTEM_NPM) # the current user. This can be an issue due to the node tarball using # uid 1000 and running the unpack in a id-mapped namespace (container) # that lets tar set the uid to a "bad" uid outside the namespace - COMMAND bash -c "chown -R $$(id -u):$$(id -g) ${mgr-dashboard-nodeenv-dir}/src" + COMMAND bash -c 'chown -R `id -u`:`id -g` ${mgr-dashboard-nodeenv-dir}/src' COMMAND mkdir ${mgr-dashboard-nodeenv-dir}/.npm WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "dashboard nodeenv is being installed")