From da6087762ab9d4cd0c2f98a31d9e4b8e9a2a4348 Mon Sep 17 00:00:00 2001 From: Justin Scott Date: Mon, 28 Oct 2019 10:16:57 -0700 Subject: [PATCH] Add CLRK8S_CLR_VER to setup_system.sh (#250) This adds ability to upgrade/downgrade to desired Clear version. The default behavior remains unchanged (auto updating to latest) Signed-off-by: Justin Scott --- clr-k8s-examples/README.md | 5 +++++ clr-k8s-examples/setup_system.sh | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/clr-k8s-examples/README.md b/clr-k8s-examples/README.md index c5ede2c..979f7c6 100644 --- a/clr-k8s-examples/README.md +++ b/clr-k8s-examples/README.md @@ -38,6 +38,11 @@ This script ensures the following script uses the runtime specified in the `RUNNER` environment variable and defaults to `crio`. To use the `containerd` runtime, set the `RUNNER` environment variable to `containerd`. +### Specify a version of Clear Linux + +To specify a particular version of Clear Linux to use, set the CLRK8S_CLR_VER environment variable to the desired +version before starting setup_system.sh (e.g. `CLRK8S_CLR_VER=31400 ./setup_system.sh`) + ### Configuration for high numbers of pods per node In order to enable running greater than 110 pods per node, set the environment diff --git a/clr-k8s-examples/setup_system.sh b/clr-k8s-examples/setup_system.sh index 9d43c8c..7d43197 100755 --- a/clr-k8s-examples/setup_system.sh +++ b/clr-k8s-examples/setup_system.sh @@ -5,6 +5,7 @@ set -o nounset # global vars CLRK8S_OS=${CLRK8S_OS:-""} +CLR_VER=${CLRK8S_CLR_VER:-""} HIGH_POD_COUNT=${HIGH_POD_COUNT:-""} # set no proxy @@ -14,6 +15,11 @@ ADD_NO_PROXY+=",$(hostname -I | sed 's/[[:space:]]/,/g')" # update os version function upate_os_version() { + if [[ -n "${CLR_VER}" ]]; + then + sudo swupd repair -m "${CLR_VER}" --picky + return + fi sudo swupd update }