diff options
author | Lars Wirzenius <liw@liw.fi> | 2023-11-05 16:19:39 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2023-11-05 16:28:18 +0200 |
commit | 706600a0d7c7fc488b427e2b72b8c300b97410f7 (patch) | |
tree | d0e1f7cd3e4b0d32f221b08c6e05b22dd859a5b6 | |
parent | 96fa1ffcb7000db71c83b7ae74fd83a0025bd4c4 (diff) | |
download | vmdb2-706600a0d7c7fc488b427e2b72b8c300b97410f7.tar.gz |
fix: remove /etc/resolv.conf when the root file system is unmounted
debootstrap seems to create it, so that it can resolve DNS names in
the chroot. However, we don't want it in the final image.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
Sponsored-by: author
-rw-r--r-- | vmdb/plugins/mount_plugin.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/vmdb/plugins/mount_plugin.py b/vmdb/plugins/mount_plugin.py index 30554b7..7a9faea 100644 --- a/vmdb/plugins/mount_plugin.py +++ b/vmdb/plugins/mount_plugin.py @@ -103,6 +103,10 @@ class MountStepRunner(vmdb.StepRunnerInterface): if mount_point is None: return + resolv_conf = os.path.join(mount_point, "etc/resolv.conf") + if os.path.exists(resolv_conf): + os.remove(resolv_conf) + try: vmdb.unmount(mount_point) except vmdb.NotMounted as e: |