Skip to content

Commit

Permalink
Use upstream yq by default; switch to v4.x commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
carboxylman committed Jun 13, 2023
1 parent 29f4c9a commit 66e9a25
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
22 changes: 14 additions & 8 deletions setup-kubespray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ echo "Your ${EXPTTYPE} instance is setting up on $NFQDN ." \
| mail -s "${EXPTTYPE} Instance Setting Up" ${SWAPPER_EMAIL} &

# First, we need yq.
are_packages_installed yq
if [ ! $? -eq 1 ]; then
if [ ! "$ARCH" = "aarch64" ]; then
$SUDO apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64
$SUDO add-apt-repository -y ppa:rmescandon/yq
maybe_install_packages yq
if [ ! $YQFROMPKG -eq 0 ]; then
are_packages_installed yq
if [ ! $? -eq 1 ]; then
if [ ! "$ARCH" = "aarch64" ]; then
$SUDO apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64
$SUDO add-apt-repository -y ppa:rmescandon/yq
maybe_install_packages yq
fi
fi
fi
which yq
Expand All @@ -34,10 +36,14 @@ if [ ! $? -eq 0 ]; then
fname=yq_linux_arm64
fi
curl -L -o /tmp/$fname.tar.gz \
https://github.com/mikefarah/yq/releases/download/v4.13.2/$fname.tar.gz
https://github.com/mikefarah/yq/releases/download/v4.34.1/$fname.tar.gz
tar -xzvf /tmp/$fname.tar.gz -C /tmp
chmod 755 /tmp/$fname
$SUDO mv /tmp/$fname /usr/local/bin/yq
if [ -e /tmp/yq.1 ]; then
$SUDO mkdir -p /usr/local/man/man1
$SUDO mv /tmp/yq.1 /usr/local/man/man1/
fi
fi

cd $OURDIR
Expand Down Expand Up @@ -342,7 +348,7 @@ EOF
fi
mi=`expr $mi + 1`
done
yq m --inplace --overwrite $OVERRIDES /tmp/metallb.yml
yq --inplace ea '. as $item ireduce ({}; . * $item )' $OVERRIDES /tmp/metallb.yml
rm -f /tmp/metallb.yml
else
echo "kube_proxy_strict_arp: true" >> $OVERRIDES
Expand Down
1 change: 1 addition & 0 deletions setup-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ DONFS=1
NFSEXPORTDIR=$STORAGEDIR/nfs
NFSMOUNTDIR=/nfs
NFSASYNC=0
YQFROMPKG=0

#
# We have an 'admin' user that gets a random password that comes in from
Expand Down

0 comments on commit 66e9a25

Please sign in to comment.