From ae24dc73c13124835bc9805b097a7c747d8d13e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 22 May 2023 08:36:01 +0200 Subject: [PATCH 1/2] local-build: Standardise what's set for the local build scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We've a discrepancy on what's set along the scripts used to build the Kata Cotainers artefacts locally. Some of those were missing a way to easily debug them in case of a failure happens, but one specific one (build-and-upload-payload.sh) could actually silently fail. All of those have been changed as part of this commut. Fixes: #6908 Signed-off-by: Fabiano FidĂȘncio --- .../local-build/kata-deploy-binaries-in-docker.sh | 1 + .../local-build/kata-deploy-build-and-upload-payload.sh | 6 ++++++ .../local-build/kata-deploy-copy-yq-installer.sh | 1 + .../kata-deploy/local-build/kata-deploy-merge-builds.sh | 1 + 4 files changed, 9 insertions(+) diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries-in-docker.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries-in-docker.sh index 70460a33bc..9f4f700e96 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-binaries-in-docker.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-binaries-in-docker.sh @@ -5,6 +5,7 @@ # SPDX-License-Identifier: Apache-2.0 # +[ -z "${DEBUG}" ] || set -x set -o errexit set -o nounset set -o pipefail diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh index 193f9511e5..be460ffa79 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-build-and-upload-payload.sh @@ -5,6 +5,12 @@ # SPDX-License-Identifier: Apache-2.0 # +[ -z "${DEBUG}" ] || set -x +set -o errexit +set -o nounset +set -o pipefail +set -o errtrace + KATA_DEPLOY_DIR="`dirname ${0}`/../../kata-deploy" KATA_DEPLOY_ARTIFACT="${1:-"kata-static.tar.xz"}" REGISTRY="${2:-"quay.io/kata-containers/kata-deploy"}" diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-copy-yq-installer.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-copy-yq-installer.sh index 1271fd8826..73323dd288 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-copy-yq-installer.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-copy-yq-installer.sh @@ -5,6 +5,7 @@ # SPDX-License-Identifier: Apache-2.0 # +[ -z "${DEBUG}" ] || set -x set -o errexit set -o nounset set -o pipefail diff --git a/tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh b/tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh index d99c49b4e2..dea0f3b895 100755 --- a/tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh +++ b/tools/packaging/kata-deploy/local-build/kata-deploy-merge-builds.sh @@ -4,6 +4,7 @@ # SPDX-License-Identifier: Apache-2.0 # +[ -z "${DEBUG}" ] || set -x set -o errexit set -o nounset set -o pipefail From 636539bf0cc6eafa8db40af3fb5f1608db219f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 22 May 2023 09:46:46 +0200 Subject: [PATCH 2/2] kata-deploy: Use apt-key.gpg from k8s.io MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We're facing some issues to download / use the public key provided by google for installing kubernetes as part of the kata-deploy image. ``` The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05 Reading package lists... Done W: GPG error: https://packages.cloud.google.com/apt kubernetes-xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05 E: The repository 'https://apt.kubernetes.io kubernetes-xenial InRelease' is not signed. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details. ``` Let's work this around following the suggestion made by @dims, at: https://github.com/kubernetes/k8s.io/pull/4837#issuecomment-1446426585 Signed-off-by: Fabiano FidĂȘncio --- tools/packaging/kata-deploy/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/packaging/kata-deploy/Dockerfile b/tools/packaging/kata-deploy/Dockerfile index 6bb470bb5a..bb579631b9 100644 --- a/tools/packaging/kata-deploy/Dockerfile +++ b/tools/packaging/kata-deploy/Dockerfile @@ -18,7 +18,7 @@ RUN \ apt-get update && \ apt-get install -y --no-install-recommends apt-transport-https ca-certificates curl xz-utils systemd && \ mkdir -p /etc/apt/keyrings/ && \ -curl -fsSLo /etc/apt/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg && \ +curl -fsSLo /etc/apt/keyrings/kubernetes-archive-keyring.gpg https://dl.k8s.io/apt/doc/apt-key.gpg && \ echo "deb [signed-by=/etc/apt/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | tee /etc/apt/sources.list.d/kubernetes.list && \ apt-get update && \ apt-get install -y --no-install-recommends kubectl && \