From f3aa0dea367490e034f651cfecdddb3124fd67d8 Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Wed, 18 Mar 2026 19:50:55 +0100 Subject: [PATCH] Fix sandbox provisioning failure due to missing LIMA_CIDATA_USER MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The provision script relied on LIMA_CIDATA_USER being set in the environment, but during cloud-init this variable is not exported — it only exists in /mnt/lima-cidata/lima.env. The file cannot be sourced directly because values like LIMA_CIDATA_COMMENT contain unquoted spaces, so we extract LIMA_CIDATA_USER with sed instead. Also ensure HOME is set for root's go install commands and explicitly set PATH when running make as the Lima user via su, since profile.d scripts may not be loaded during cloud-init provisioning. Signed-off-by: Bryan Frimin --- contrib/lima/provision.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/contrib/lima/provision.sh b/contrib/lima/provision.sh index cdec9abe2..d632412eb 100755 --- a/contrib/lima/provision.sh +++ b/contrib/lima/provision.sh @@ -4,6 +4,11 @@ set -euo pipefail +# Read Lima user from cidata (values are unquoted so we cannot source the file +# directly — LIMA_CIDATA_COMMENT may contain spaces). +LIMA_CIDATA_USER="$(sed -n 's/^LIMA_CIDATA_USER=//p' /mnt/lima-cidata/lima.env)" +export LIMA_CIDATA_USER + export DEBIAN_FRONTEND=noninteractive GO_VERSION="1.26.1" @@ -64,6 +69,7 @@ GOEOF chmod +x /etc/profile.d/go.sh export PATH="/usr/local/go/bin:$PATH" +export HOME="${HOME:-/root}" GOBIN=/usr/local/bin /usr/local/go/bin/go install "gotest.tools/gotestsum@${GOTESTSUM_VERSION}" GOBIN=/usr/local/bin /usr/local/go/bin/go install "github.com/golangci/golangci-lint/v2/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}" @@ -90,7 +96,7 @@ chown -R "${LIMA_USER}:${LIMA_USER}" "${LIMA_HOME}/.parallel" # Generate sandbox-specific probod config and frontend .env files VM_IP=$(ip -4 -j addr show dev lima0 | jq -r '.[0].addr_info[0].local') -su - "${LIMA_USER}" -c "cd /workspace && make bin/probod-bootstrap" +su - "${LIMA_USER}" -c "export PATH=/usr/local/go/bin:\$HOME/go/bin:\$PATH && cd /workspace && make bin/probod-bootstrap" mkdir -p /etc/probod