From b00541464dd19f1989dc21bac60cc53c18ec6bae Mon Sep 17 00:00:00 2001 From: Fabian Wiesel Date: Fri, 31 May 2024 11:22:10 +0200 Subject: [PATCH] [ignite] Install patched ignition early --- features/ignite/exec.config | 7 +------ features/ignite/exec.early | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/features/ignite/exec.config b/features/ignite/exec.config index 419dfd68c..e4c2c6816 100755 --- a/features/ignite/exec.config +++ b/features/ignite/exec.config @@ -1,7 +1,2 @@ #!/usr/bin/env bash -set -Eeuox pipefail - -TEMP_DEB="$(mktemp)" -wget -O "$TEMP_DEB" 'https://repo.eu-de-1.cloud.sap/gardenlinux/ignition_2.18.0-0gardenlinux~experimental_amd64.deb' -DEBIAN_FRONTEND=noninteractive dpkg -i "$TEMP_DEB" -rm -f "$TEMP_DEB" +set -Eeuxo pipefail diff --git a/features/ignite/exec.early b/features/ignite/exec.early index a4f0d6106..dd505b411 100755 --- a/features/ignite/exec.early +++ b/features/ignite/exec.early @@ -1,4 +1,28 @@ #!/usr/bin/env bash +set -Eeuo pipefail + +TEMP_DEB="$(mktemp)" + +function __curl() { + read -r proto server path <<<"$(printf '%s' "${1//// }")" + DOC=/${path// //} + HOST=${server//:*} + PORT=${server//*:} + [ "${HOST}" = "${PORT}" ] && PORT=80 + + exec 3<>"/dev/tcp/${HOST}/$PORT" + printf 'GET %s HTTP/1.0\r\nHost: %s\r\n\r\n' "${DOC}" "${HOST}" >&3 + (while read -r line; do + [ "$line" = $'\r' ] && break + done && cat) <&3 + exec 3>&- +} + +__curl 'http://repo.eu-de-1.cloud.sap/gardenlinux/ignition_2.18.0-0gardenlinux~experimental_amd64.deb' > "$TEMP_DEB/ignition_2.18.0-0gardenlinux~experimental_amd64.deb" + +DEBIAN_FRONTEND=noninteractive dpkg -i "$TEMP_DEB" +rm -f "$TEMP_DEB" + case "$BUILDER_CNAME" in kvm*)