fix(oci): a shared host directory shows what the host has mounted inside it

This commit is contained in:
MacRimi
2026-10-10 20:52:52 +02:00
parent a1bac7aeec
commit 155cafcb73
12 changed files with 269 additions and 8 deletions
+5 -3
View File
@@ -9,6 +9,7 @@ import os
import oci_console
import oci_gpu_devices
import oci_nested_mounts
from oci_ui import translate
@@ -617,12 +618,13 @@ def normalize(record):
preserved = {key: single(key) for key in ('arch', 'ostype', 'cmode', 'console', 'tty', 'cpuunits',
'net0', 'net1', 'startup', 'hookscript', 'features', 'tags') if key in values}
devices = [{'key': key, 'value': single(key)} for key in values if re.fullmatch(r'dev[0-9]+', key)]
# The console log line and its start hook are not replayed: the installer
# that rebuilds the member sets them itself, and replaying them too would
# leave two of each.
# The console log line, its start hook and what shows the content mounted
# inside a host directory are not replayed: the installer that rebuilds the
# member sets them itself, and replaying them too would leave two of each.
raw_runtime = [line for line in config.splitlines() if line.startswith('lxc.')
and line.partition(': ')[0] not in ('lxc.environment.runtime', 'lxc.init.cwd',
'lxc.signal.halt', 'lxc.console.logfile')
and not oci_nested_mounts.own(line)
and not oci_console.is_start_mark_hook(line)]
return {'schema_version': 1, 'deployment': plan, 'runtime': runtime,
'preserved_native': preserved, 'generated_files': copy.deepcopy(files),