From 848acf405ac1ea54e8172593be43addd63490d51 Mon Sep 17 00:00:00 2001 From: Saba Touheed Mujawar Date: Tue, 14 Feb 2023 08:45:11 -0500 Subject: [PATCH] Remove update_feature_gates_v1_24 function. During a K8s feature upgrade from 1.23 to 1.24 the update_feature_gates_v1_24 function in this script removes all lines containing "feature-gates" from the file. If the end user has specified any additional feature gates using the "custom kubernetes configuration" functionality, it will be erroneously removed by this function. Test Plan: PASS: Package builds successfully PASS: Upgrade k8s 1.23.1 to 1.24.4 Closes-Bug: 2000864 Depends-On: https://review.opendev.org/c/starlingx/config/+/870964 The above config repo change makes this function no longer pertinent so we remove it as cleanup Signed-off-by: Saba Touheed Mujawar Change-Id: I36a0b5a5b4894e8d8a082716c489bed6473a208b --- .../debian/deb_folder/upgrade_k8s_config.sh | 25 ------------------- 1 file changed, 25 deletions(-) diff --git a/kubernetes/kubernetes-unversioned/debian/deb_folder/upgrade_k8s_config.sh b/kubernetes/kubernetes-unversioned/debian/deb_folder/upgrade_k8s_config.sh index 61734af3f..0b59d3890 100755 --- a/kubernetes/kubernetes-unversioned/debian/deb_folder/upgrade_k8s_config.sh +++ b/kubernetes/kubernetes-unversioned/debian/deb_folder/upgrade_k8s_config.sh @@ -67,29 +67,6 @@ function get_kubeadm_configmap { fi } -# Update feature gates for version 1.24 -function update_feature_gates_v1_24 { - - if grep -q 'RemoveSelfLink=false' "${KUBEADM_CONFIGMAP_TMPFILE}"; then - LOG "Updating kube-apiserver feature-gates in retrieved kubeadm-config" - if sed -i '/feature-gates/d' "${KUBEADM_CONFIGMAP_TMPFILE}"; then - if ! grep -q 'RemoveSelfLink=false' "${KUBEADM_CONFIGMAP_TMPFILE}"; - then - LOG "Successfully updated retrieved kubeadm-config" - else - ERROR 'Failed to update kube-apiserver feature-gates with an unknown error' - cleanup_and_exit 1 - fi - else - RC=$? - ERROR "Failed to update ${KUBEADM_CONFIGMAP_TMPFILE} with error code: [${RC}]" - cleanup_and_exit ${RC} - fi - else - LOG "Kubeadm configmap was already updated with RemoveSelfLink=false removed. Nothing to do." - fi -} - # Update feature gates for version 1.22 function update_feature_gates_v1_22 { LOG "Updating kube-apiserver feature-gates in retrieved kubeadm-config" @@ -155,8 +132,6 @@ until [ ${counter} -gt ${RETRIES} ]; do get_kubeadm_configmap if [[ "${K8S_VERSION}" == "v1.21.8" ]]; then update_feature_gates_v1_22 - elif [[ "${K8S_VERSION}" == "v1.23.1" ]]; then - update_feature_gates_v1_24 else LOG "No update required for kubeadm configmap" break