From e5720543437979eba33d209cd3c277565af8383e Mon Sep 17 00:00:00 2001 From: Sofus Albertsen Date: Fri, 22 Mar 2024 17:35:47 +0100 Subject: [PATCH] Upgrade Kubernetes version and add support for specific version --- upgrade_edge/upgrade_edge.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/upgrade_edge/upgrade_edge.sh b/upgrade_edge/upgrade_edge.sh index b6c631d..901a229 100755 --- a/upgrade_edge/upgrade_edge.sh +++ b/upgrade_edge/upgrade_edge.sh @@ -78,8 +78,14 @@ get_current_k8s_version() { # Upgrade Kubernetes upgrade_kubernetes() { - echo "Upgrading Kubernetes to version $NEXT_VERSION..." - ./talosctl-"${server_version}" -n $SERVER_IP -e $SERVER_IP upgrade-k8s --to $NEXT_VERSION + echo "Upgrading Kubernetes..." + ./talosctl-"${server_version}" -n $SERVER_IP -e $SERVER_IP upgrade-k8s +} +# Upgrade Kubernetes +upgrade_kubernetes_specific_version() { + + echo "Upgrading Kubernetes to version $KUBERNETES_VERSION ..." + ./talosctl-"${server_version}" -n $SERVER_IP -e $SERVER_IP upgrade-k8s --to $KUBERNETES_VERSION } if [ "$UPGRADE_TALOS" = "true" ] && [ "$UPGRADE_KUBERNETES" = "true" ] ; then @@ -93,5 +99,9 @@ elif [ "$UPGRADE_KUBERNETES" = "true" ]; then check_talos_version_existence check_talosctl_version get_current_k8s_version - upgrade_kubernetes + if [[ -z "$KUBERNETES_VERSION" ]]; then #if it exists + upgrade_kubernetes_specific_version + else + upgrade_kubernetes + fi fi