Skip to content

Commit 78cfbe5

Browse files
sprtRedent0r
authored andcommitted
node-builder: Fix SHIM_USE_DEBUG_CONFIG behavior
Using a symlink would create a cycle after calling this script again when copying the final configuration at line 74 so we just use cp instead. Also, I moved this block to the end of the file to properly override the final config file. Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
1 parent e7590a6 commit 78cfbe5

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

tools/osbuilder/node-builder/azure-linux/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ This section describes how to build and deploy in debug mode.
180180
* `SHIM_USE_DEBUG_CONFIG`: Specify `no` (default) to use the production
181181
configuration, or `yes` to use the debug configuration (all debug
182182
logging enabled). In this case you'll want to enable debug logging
183-
in containerd as well.
183+
in containerd as well. Note that this variable has no effect if
184+
`SHIM_REDEPLOY_CONFIG=no`.
184185

185186
In general, you can specify the debug configuration for all the above
186187
variables by using `BUILD_TYPE=debug` as such:

tools/osbuilder/node-builder/azure-linux/package_install.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,6 @@ if [ "${CONF_PODS}" == "yes" ]; then
4646
echo "Skipping installation of SNP shim debug configuration"
4747
fi
4848

49-
if [ "${SHIM_USE_DEBUG_CONFIG}" == "yes" ]; then
50-
# We simply override the release config with the debug config,
51-
# which is probably fine when debugging.
52-
ln -sf src/runtime/config/"${SHIM_DBG_CONFIG_FILE_NAME}" src/runtime/config/"${SHIM_CONFIG_FILE_NAME}"
53-
fi
54-
5549
echo "Enabling and starting snapshotter service"
5650
if [ "${START_SERVICES}" == "yes" ]; then
5751
systemctl enable tardev-snapshotter && systemctl daemon-reload && systemctl restart tardev-snapshotter
@@ -70,6 +64,14 @@ cp -a --backup=numbered src/runtime/containerd-shim-kata-v2 "${PREFIX}/${SHIM_BI
7064
if [ "${SHIM_REDEPLOY_CONFIG}" == "yes" ]; then
7165
echo "Installing shim configuration"
7266
cp -a --backup=numbered src/runtime/config/"${SHIM_CONFIG_FILE_NAME}" "${PREFIX}/${SHIM_CONFIG_PATH}/${SHIM_CONFIG_INST_FILE_NAME}"
67+
68+
if [ "${CONF_PODS}" == "yes" ] && [ "${SHIM_USE_DEBUG_CONFIG}" == "yes" ]; then
69+
# We simply override the release config with the debug config,
70+
# which is probably fine when debugging. Not symlinking as that
71+
# would create cycles the next time this script is called.
72+
echo "Overriding shim configuration with SNP debug configuration"
73+
cp -a --backup=numbered src/runtime/config/"${SHIM_DBG_CONFIG_FILE_NAME}" "${PREFIX}/${SHIM_CONFIG_PATH}/${SHIM_CONFIG_INST_FILE_NAME}"
74+
fi
7375
else
7476
echo "Skipping installation of shim configuration"
7577
fi

0 commit comments

Comments
 (0)