Fix deploy start kubernetes mount points

With commit [1] the kubernetes location was changed from /usr/local
to /var/lib, making the deploy start inside chroot fail.

This commit fixes the issue.

[1] https://review.opendev.org/c/starlingx/stx-puppet/+/916338

Test Plan
PASS: run deploy start successfully

Story: 2010676
Task: 50059

Change-Id: I2065d0130c9916a60ee7b963c865dcb43c733a39
Signed-off-by: Heitor Matsui <heitorvieira.matsui@windriver.com>
This commit is contained in:
Heitor Matsui 2024-05-08 15:53:19 -03:00
parent eefb215a96
commit e1eeeca9ee
3 changed files with 2 additions and 9 deletions

View File

@ -18,6 +18,7 @@ DEV_PATH=/dev
PLATFORM_PATH=/opt/platform
RABBIT_PATH=/var/lib/rabbitmq
POSTGRES_PATH=/var/lib/postgresql
KUBERNETES_PATH=/var/lib/kubernetes
PLATFORM_CONF_PATH=/etc/platform
TMP_PATH=/tmp
USR_PATH=/usr
@ -33,6 +34,7 @@ mount_points=(
"${PLATFORM_PATH}:${OSTREE_DEPLOYMENT_BRANCH}/${PLATFORM_PATH}"
"${RABBIT_PATH}:${OSTREE_DEPLOYMENT_BRANCH}/${RABBIT_PATH}"
"${POSTGRES_PATH}:${OSTREE_DEPLOYMENT_BRANCH}/${POSTGRES_PATH}"
"${KUBERNETES_PATH}:${OSTREE_DEPLOYMENT_BRANCH}/${KUBERNETES_PATH}"
"${PROC_PATH}:${OSTREE_DEPLOYMENT_BRANCH}/${PROC_PATH}"
"${LOG_PATH}:${OSTREE_DEPLOYMENT_BRANCH}/${LOG_PATH}"
"${OSTREE_DEPLOYMENT_BRANCH}/${USR_PATH}/${ETC_PATH}:${OSTREE_DEPLOYMENT_BRANCH}/${ETC_PATH}"

View File

@ -57,13 +57,6 @@ unmount_filesystems() {
local rc=0
info "Attempting to unmount filesystems under ${rootdir}..."
k8s_umount_output=$(sudo umount ${rootdir}/usr/local/kubernetes/current 2>&1)
if [ $? -ne 0 ]; then
if [[ ! $k8s_umount_output =~ "not mounted" ]]; then
rc=1
error $k8s_umount_output
fi
fi
sudo ${rootdir}/usr/sbin/software-deploy/chroot_mounts.sh ${rootdir} -u
if [ $? -ne 0 ]; then
rc=1

View File

@ -115,8 +115,6 @@ sudo ostree --repo=${repo} checkout ${commit_id} ${rootdir} || handle_error $? "
# create proper mounts on deploy file system
info "Creating mount points..."
sudo ${script_dir}/chroot_mounts.sh ${rootdir} || handle_error $? "Failed to mount required mount points"
sudo mount --bind ${rootdir}/usr/local/kubernetes/${k8s_ver} ${rootdir}/usr/local/kubernetes/current
sudo cp /etc/kubernetes/admin.conf ${rootdir}/etc/kubernetes/
info "Mount points created successfully"