Fix stale or missing ostree_repo bind mount in iso dir
This commit addresses the odd cases where the
/var/www/pages/iso/<rel>/ostree_repo bind mount
becomes missing or stale.
We add detection of missing content, and also detect a stale bind mount.
A stale bind mount is detected by comparing the inode numbers
of the bind-mounted /var/www/pages/iso/<rel>/ostree_repo and original
/var/www/pages/feed/rel-<rel>/ostree_repo directory.
NOTES:
- The self.www_root variable is changed to self.www_iso_root to make
it more obvious that this is the /var/www/pages/iso path, not the feed
path.
- Now using the 'sh' python library for the mount commands, which is
much more convenient and straight-forward than the subprocess library
Test Plan:
PASS:
- Unmount (but do not delete) the /var/www/pages/iso/<rel>/ostree_repo
directory. When a subcloud add or deploy operation is done, the bind
mount is recreated.
- Stale mount:
# Replace the original
sudo cp -a /var/www/pages/feed/rel-24.09/ostree_repo \ /var/www/pages/feed/rel-24.09/ostree_repo.orig
sudo rm -rf /var/www/pages/feed/rel-24.09/ostree_repo
sudo cp -a /var/www/pages/feed/rel-24.09/ostree_repo.orig \ /var/www/pages/feed/rel-24.09/ostree_repo
When a subcloud add or deploy operation is done, the stale bind
mount is detected. The /var/www/pages/iso/24.09/ostree_repo is
unmounted, and the directory is removed.
When a subcloud add or deploy operation is done, the bind
mount is recreated.
Reviewed: https:/ /review. opendev. org/c/starlingx /distcloud/ +/920194 /opendev. org/starlingx/ distcloud/ commit/ a60ce81f2600dce fe988a92a1c92e4 50a7e0ba7f
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit a60ce81f2600dce fe988a92a1c92e4 50a7e0ba7f
Author: Kyle MacLeod <email address hidden>
Date: Wed May 22 12:13:14 2024 -0400
Fix stale or missing ostree_repo bind mount in iso dir
This commit addresses the odd cases where the www/pages/ iso/<rel> /ostree_ repo bind mount
/var/
becomes missing or stale.
We add detection of missing content, and also detect a stale bind mount.
A stale bind mount is detected by comparing the inode numbers pages/iso/ <rel>/ostree_ repo and original www/pages/ feed/rel- <rel>/ostree_ repo directory.
of the bind-mounted /var/www/
/var/
NOTES:
- The self.www_root variable is changed to self.www_iso_root to make
it more obvious that this is the /var/www/pages/iso path, not the feed
path.
- Now using the 'sh' python library for the mount commands, which is
much more convenient and straight-forward than the subprocess library
Test Plan: pages/iso/ <rel>/ostree_ repo pages/feed/ rel-24. 09/ostree_ repo \
/var/ www/pages/ feed/rel- 24.09/ostree_ repo.orig pages/feed/ rel-24. 09/ostree_ repo pages/feed/ rel-24. 09/ostree_ repo.orig \
/var/ www/pages/ feed/rel- 24.09/ostree_ repo pages/iso/ 24.09/ostree_ repo is
PASS:
- Unmount (but do not delete) the /var/www/
directory. When a subcloud add or deploy operation is done, the bind
mount is recreated.
- Stale mount:
# Replace the original
sudo cp -a /var/www/
sudo rm -rf /var/www/
sudo cp -a /var/www/
When a subcloud add or deploy operation is done, the stale bind
mount is detected. The /var/www/
unmounted, and the directory is removed.
When a subcloud add or deploy operation is done, the bind
mount is recreated.
Closes-Bug: 2066411
Change-Id: I25911722b1e333 cd352f142664526 d7dfa73e9e8
Signed-off-by: Kyle MacLeod <email address hidden>