kata-deploy: fix k3s containerd check

The default k3s containerRuntimeVersion takes the form of:
containerd://1.3.3-k3s2

The awk was stripping away the k3s portion before checking if it was a
k3s containerd.

fixes #996

Signed-off-by: Brandon Wilson <brandon@coil.com>
This commit is contained in:
Brandon Wilson 2020-04-03 12:33:10 -05:00
parent b4ecfdb2dc
commit 96f3b99c7a
No known key found for this signature in database
GPG Key ID: 63D308951E83ECF9

View File

@ -33,7 +33,7 @@ function print_usage() {
function get_container_runtime() {
local runtime=$(kubectl get node $NODE_NAME -o jsonpath='{.status.nodeInfo.containerRuntimeVersion}' | awk -F '[:]' '{print $1}')
local runtime=$(kubectl get node $NODE_NAME -o jsonpath='{.status.nodeInfo.containerRuntimeVersion}')
if [ "$?" -ne 0 ]; then
die "invalid node name"
fi
@ -44,7 +44,7 @@ function get_container_runtime() {
echo "k3s"
fi
else
echo "$runtime"
echo "$runtime" | awk -F '[:]' '{print $1}'
fi
}