From 24d71b05f5637b92f1b583be049e24cc2af6df9c Mon Sep 17 00:00:00 2001 From: Evan Johnson Date: Thu, 15 Aug 2024 14:59:06 -0400 Subject: [PATCH] fix check for missing stackscript --- cloud/services/stackscripts.go | 2 +- scripts/pre-kubeadminit.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cloud/services/stackscripts.go b/cloud/services/stackscripts.go index 138a2b021..7c624c4d2 100644 --- a/cloud/services/stackscripts.go +++ b/cloud/services/stackscripts.go @@ -32,7 +32,7 @@ func EnsureStackscript(ctx context.Context, machineScope *scope.MachineScope) (i if util.IgnoreLinodeAPIError(err, http.StatusNotFound) != nil { return 0, fmt.Errorf("failed to get stackscript with label %s: %w", stackscriptName, err) } - if stackscripts != nil { + if len(stackscripts) != 0 { return stackscripts[0].ID, nil } stackscriptCreateOptions := linodego.StackscriptCreateOptions{ diff --git a/scripts/pre-kubeadminit.sh b/scripts/pre-kubeadminit.sh index 6c57975ce..1bcc09c8d 100644 --- a/scripts/pre-kubeadminit.sh +++ b/scripts/pre-kubeadminit.sh @@ -73,7 +73,7 @@ EOF sed -i '/swap/d' /etc/fstab swapoff -a # check for required tools and only install missing tools -REQUIRED_TOOLS=(containerd socat conntrack iptables) +REQUIRED_TOOLS=(containerd socat conntrack ethtool iptables) INSTALL_TOOLS=() for tool in ${REQUIRED_TOOLS[*]}; do echo "checking for ${tool}" @@ -85,7 +85,7 @@ done export DEBIAN_FRONTEND=noninteractive apt-get update -y # use containerd files we write instead of package defaults -apt-get install -o Dpkg::Options::="--force-confold" -y "${INSTALL_TOOLS[*]}" +apt-get install -o Dpkg::Options::="--force-confold" -y ${INSTALL_TOOLS[*]} PATCH_VERSION=${1#[v]} VERSION=${PATCH_VERSION%.*}