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 <sabatouheed.mujawar@windriver.com>
Change-Id: I36a0b5a5b4894e8d8a082716c489bed6473a208b
This commit is contained in:
Saba Touheed Mujawar 2023-02-14 08:45:11 -05:00
parent ea7eea3e5c
commit 848acf405a

View File

@ -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