kata-deploy: Change default values of DEBUG

This can be easily done as there was no official release with the
previous values.

The reason we're doing so is because when using `yq` to replace the
value, even when forcing `--tag '!!str' "yes"`, the content is placed
without quotes, causing errors in our CI.

While here, we're also removing the fallback value for DEBUG, as it is
**always** set in the kata-deploy.yaml file.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
Fabiano Fidêncio 2023-07-26 16:07:59 +02:00
parent 69535b8089
commit a274333248
4 changed files with 7 additions and 7 deletions

View File

@ -71,7 +71,7 @@ function deploy_kata() {
sed -i -e "s|quay.io/kata-containers/kata-deploy:latest|${DOCKER_REGISTRY}/${DOCKER_REPO}:${DOCKER_TAG}|g" "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml"
# Enable debug for Kata Containers
yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[1].value' "\"yes\""
yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[1].value' --tag '!!str' "true"
if [ "${KATA_HOST_OS}" = "cbl-mariner" ]; then
yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" 'spec.template.spec.containers[0].env[+].name' "HOST_OS"

View File

@ -27,7 +27,7 @@ spec:
fieldRef:
fieldPath: spec.nodeName
- name: DEBUG
value: "no"
value: "false"
- name: SHIMS
value: "clh dragonball fc qemu-nvidia-gpu qemu-sev qemu-snp qemu-tdx qemu"
- name: DEFAULT_SHIM

View File

@ -29,7 +29,7 @@ spec:
fieldRef:
fieldPath: spec.nodeName
- name: DEBUG
value: "no"
value: "false"
- name: SHIMS
value: "clh dragonball fc qemu qemu-nvidia-gpu qemu-sev qemu-snp qemu-tdx"
- name: DEFAULT_SHIM

View File

@ -58,7 +58,7 @@ function install_artifacts() {
chmod +x /opt/kata/runtime-rs/bin/*
# Allow enabling debug for Kata Containers
if [[ "${DEBUG:-"no"}" == "yes" ]]; then
if [[ "${DEBUG}" == "true" ]]; then
config_path="/opt/kata/share/defaults/kata-containers/"
for shim in "${shims[@]}"; do
sed -i -e 's/^#\(enable_debug\).*=.*$/\1 = true/g' "${config_path}/configuration-${shim}.toml"
@ -216,7 +216,7 @@ function configure_crio() {
done
if [ "${DEBUG:-"no"}" == "yes" ]; then
if [ "${DEBUG}" == "true" ]; then
cat <<EOF | tee -a $crio_drop_in_conf_file_debug
[crio]
log_level = "debug"
@ -261,7 +261,7 @@ EOF
EOF
fi
if [ "${DEBUG:-"no"}" == "yes" ]; then
if [ "${DEBUG}" == "true" ]; then
if grep -q "\[debug\]" $containerd_conf_file; then
sed -i 's/level.*/level = \"debug\"/' $containerd_conf_file
else
@ -314,7 +314,7 @@ function cleanup_cri_runtime() {
function cleanup_crio() {
rm $crio_drop_in_conf_file
if [[ "${DEBUG:-"no"}" == "yes" ]]; then
if [[ "${DEBUG}" == "true" ]]; then
rm $crio_drop_in_conf_file_debug
fi
}