mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-11-01 10:22:08 +00:00
fix(oci): allow IPv6 entrypoints during native updates
This commit is contained in:
@@ -567,7 +567,7 @@ def preflight(record, candidate, config, coordinated=None, in_place=False, basel
|
||||
or any(not re.fullmatch(r'[A-Za-z0-9_.-]+:[^\s,]+', value) or value in used_volumes
|
||||
for value in detached.values())):
|
||||
raise ValueError(translate('The container disks do not match the saved record'))
|
||||
if '[' in config.decode() or keys - BASIC - runtime_keys - coordinated_keys - preserved_keys - {k for k in keys if re.fullmatch(r'(mp|dev|unused)[0-9]+', k)}:
|
||||
if re.search(r'^\[[^]\r\n]+\]\s*$', config.decode(), re.MULTILINE) or keys - BASIC - runtime_keys - coordinated_keys - preserved_keys - {k for k in keys if re.fullmatch(r'(mp|dev|unused)[0-9]+', k)}:
|
||||
raise ValueError(translate('The container has advanced Proxmox settings outside the supported profile'))
|
||||
unprivileged = deployment.get('security', {}).get('unprivileged', True) is not False
|
||||
if (desired.get('security', {}).get('unprivileged', True) is not False) != unprivileged \
|
||||
|
||||
@@ -27,6 +27,23 @@ def installation():
|
||||
return result,config
|
||||
|
||||
|
||||
class SnapshotSectionGuardTests(unittest.TestCase):
|
||||
def test_ipv6_listen_address_in_oci_entrypoint_is_not_a_snapshot(self):
|
||||
saved, config = installation()
|
||||
config += b"entrypoint: entrypoint.sh php -S '[::]:8080' -t /var/www/html\n"
|
||||
saved['observed'].update(config=config.decode(), config_sha256=transaction.sha(config))
|
||||
with patch.object(transaction, 'external_changes', return_value={}):
|
||||
transaction.preflight(saved, copy.deepcopy(saved), config)
|
||||
|
||||
def test_actual_proxmox_snapshot_section_is_still_refused(self):
|
||||
saved, config = installation()
|
||||
config += b"\n[before-upgrade]\nmemory: 512\n"
|
||||
saved['observed'].update(config=config.decode(), config_sha256=transaction.sha(config))
|
||||
with patch.object(transaction, 'external_changes', return_value={}), \
|
||||
self.assertRaisesRegex(ValueError, 'advanced Proxmox settings'):
|
||||
transaction.preflight(saved, copy.deepcopy(saved), config)
|
||||
|
||||
|
||||
class FallbackTests(unittest.TestCase):
|
||||
def test_all_installer_adaptations_fall_back_before_any_native_write(self):
|
||||
saved,config=installation()
|
||||
|
||||
Reference in New Issue
Block a user