Merge "Add support for symlinks instead of bindmounts for version control"

This commit is contained in:
Zuul 2024-04-26 14:05:31 +00:00 committed by Gerrit Code Review
commit 1d6add41a2
2 changed files with 22 additions and 16 deletions

View File

@ -287,14 +287,17 @@ def mount_new_deployment(deployment_dir):
LOG.warning(info_msg)
raise OSTreeCommandFail(msg)
finally:
try:
sh.mount("/usr/local/kubernetes/current/stage1")
sh.mount("/usr/local/kubernetes/current/stage2")
except sh.ErrorReturnCode:
msg = "Failed to mount kubernetes. Please manually run these commands:\n" \
"sudo mount /usr/local/kubernetes/current/stage1\n" \
"sudo mount /usr/local/kubernetes/current/stage2\n"
LOG.info(msg)
# Handle the switch from bind mounts to symlinks for K8s versions.
# Can be removed once the switch is complete.
if os.path.isdir('/usr/local/kubernetes/current'):
try:
sh.mount("/usr/local/kubernetes/current/stage1")
sh.mount("/usr/local/kubernetes/current/stage2")
except sh.ErrorReturnCode:
msg = "Failed to mount kubernetes. Please manually run these commands:\n" \
"sudo mount /usr/local/kubernetes/current/stage1\n" \
"sudo mount /usr/local/kubernetes/current/stage2\n"
LOG.info(msg)
def delete_older_deployments():

View File

@ -313,14 +313,17 @@ def mount_new_deployment(deployment_dir):
LOG.warning(info_msg)
raise OSTreeCommandFail(msg)
finally:
try:
sh.mount("/usr/local/kubernetes/current/stage1")
sh.mount("/usr/local/kubernetes/current/stage2")
except sh.ErrorReturnCode:
msg = "Failed to mount kubernetes. Please manually run these commands:\n" \
"sudo mount /usr/local/kubernetes/current/stage1\n" \
"sudo mount /usr/local/kubernetes/current/stage2\n"
LOG.info(msg)
# Handle the switch from bind mounts to symlinks for K8s versions.
# Can be removed once the switch is complete.
if os.path.isdir('/usr/local/kubernetes/current'):
try:
sh.mount("/usr/local/kubernetes/current/stage1")
sh.mount("/usr/local/kubernetes/current/stage2")
except sh.ErrorReturnCode:
msg = "Failed to mount kubernetes. Please manually run these commands:\n" \
"sudo mount /usr/local/kubernetes/current/stage1\n" \
"sudo mount /usr/local/kubernetes/current/stage2\n"
LOG.info(msg)
def delete_older_deployments():