diff --git a/tools/packaging/kata-deploy/Dockerfile b/tools/packaging/kata-deploy/Dockerfile index 95f07f1430..8bcd0f298a 100644 --- a/tools/packaging/kata-deploy/Dockerfile +++ b/tools/packaging/kata-deploy/Dockerfile @@ -10,6 +10,14 @@ ARG DESTINATION=/opt/kata-artifacts COPY ${KATA_ARTIFACTS} ${WORKDIR} +# I understand that in order to be on the safer side, it'd +# be good to have the alpine packages pointing to a very +# specific version, but this may break anyone else trying +# to use a different version of alpine for one reason or +# another. With this in mind, let's ignore DL3018. +# SC2086 is about using double quotes to prevent globbing and +# word splitting, which can also be ignored for now. +# hadolint ignore=DL3018,SC2086 RUN \ apk --no-cache add bash curl && \ ARCH=$(uname -m) && \ @@ -20,7 +28,9 @@ RUN \ mkdir -p ${DESTINATION} && \ tar xvf ${WORKDIR}/${KATA_ARTIFACTS} -C ${DESTINATION} && \ rm -f ${WORKDIR}/${KATA_ARTIFACTS} && \ - apk del curl + apk del curl && \ + apk --no-cache add jq py3-pip && \ + pip install --no-cache-dir yq==3.2.3 COPY scripts ${DESTINATION}/scripts COPY runtimeclasses ${DESTINATION}/runtimeclasses diff --git a/tools/packaging/kata-deploy/scripts/kata-deploy.sh b/tools/packaging/kata-deploy/scripts/kata-deploy.sh index 58517480f6..7ff1b54d8a 100755 --- a/tools/packaging/kata-deploy/scripts/kata-deploy.sh +++ b/tools/packaging/kata-deploy/scripts/kata-deploy.sh @@ -294,14 +294,11 @@ function cleanup_different_shims_base() { } function configure_crio_runtime() { - local runtime="kata" - local configuration="configuration" - if [ -n "${1-}" ]; then - runtime+="-$1" - configuration+="-$1" - fi + local shim="${1}" + local runtime="kata-${shim}" + local configuration="configuration-${shim}" - local config_path=$(get_kata_containers_config_path "${1}") + local config_path=$(get_kata_containers_config_path "${shim}") local kata_path="/usr/local/bin/containerd-shim-${runtime}-v2" local kata_conf="crio.runtime.runtimes.${runtime}" @@ -309,7 +306,6 @@ function configure_crio_runtime() { cat <" $containerd_conf_file || [ "$1" == "k0s-worker" ] || [ "$1" == "k0s-controller" ]; then pluginid=\"io.containerd.grpc.v1.cri\" fi - local runtime_table="plugins.${pluginid}.containerd.runtimes.$runtime" - local runtime_type="io.containerd.$runtime.v2" - local options_table="$runtime_table.options" - local config_path="$(get_kata_containers_config_path "$2")/$configuration.toml" - if grep -q "\[$runtime_table\]" $containerd_conf_file; then - echo "Configuration exists for $runtime_table, overwriting" - sed -i "/\[$runtime_table\]/,+1s#runtime_type.*#runtime_type = \"${runtime_type}\"#" $containerd_conf_file - else - cat <