Update setup-kubetools.sh

Current sed line breaks /etc/fstab as it puts the '#' between '/' and "swap".  Instead, match the fstype field ("swap" surrounded by spaces) and prepend a '#' to the beginning of the line if it does not already start with one (idempotent ;) ).
This commit is contained in:
D. M. Brownlee 2023-03-30 13:42:11 -07:00 committed by GitHub
parent 6ff42c3fad
commit 414cf806a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,7 +33,7 @@ EOF
sudo apt-mark hold kubelet kubeadm kubectl
swapoff -a
sed -i 's/swap/#swap/' /etc/fstab
sed -r -i 's/^([^#].*[[:space:]]swap[[:space:]].*)$/#\1/' /etc/fstab
fi
# Set iptables bridging