feat(oci): VLAN tag and updates that keep Proxmox changes

This commit is contained in:
MacRimi
2026-10-31 18:34:14 +01:00
parent b1010a194a
commit 276a116696
47 changed files with 672 additions and 125 deletions
+10
View File
@@ -136,6 +136,16 @@ def parse_config(data):
return values
def container_curl(vmid, run=command):
"""curl for an address of this container. The host may have no route to the
VLAN of an interface: there it runs inside the network of the container."""
config = parse_config(run('pct', 'config', str(vmid)))
if not any(re.fullmatch(r'net[0-9]+', key) and re.search(r'(^|,)tag=', value) for key, value in config.items()):
return ['curl']
pid = run('lxc-info', '-n', str(vmid), '-pH').decode().strip()
return ['nsenter', f'--net=/proc/{pid}/ns/net', 'curl']
def private_directory(path):
path.mkdir(parents=True, exist_ok=True, mode=0o700)
if path.is_symlink() or path.stat().st_uid != os.geteuid():