wrapper: add Wrapper.argv_override
This commit is contained in:
parent
ec0e430c00
commit
d2d9cb6c7c
2 changed files with 9 additions and 2 deletions
|
@ -86,7 +86,12 @@ class DockerWrapper(BaseWrapper):
|
||||||
'--privileged',
|
'--privileged',
|
||||||
] + docker_volumes_args(volumes) + [tag]
|
] + docker_volumes_args(volumes) + [tag]
|
||||||
|
|
||||||
kupfer_cmd = ['kupferbootstrap', '--config', volumes[wrapped_config]] + self.filter_args_wrapper(sys.argv[1:])
|
kupfer_cmd = [
|
||||||
|
'kupferbootstrap',
|
||||||
|
'--config',
|
||||||
|
volumes[wrapped_config],
|
||||||
|
]
|
||||||
|
kupfer_cmd += self.argv_override or self.filter_args_wrapper(sys.argv[1:])
|
||||||
if config.runtime.uid:
|
if config.runtime.uid:
|
||||||
kupfer_cmd = ['wrapper_su_helper', '--uid', str(config.runtime.uid), '--username', 'kupfer', '--'] + kupfer_cmd
|
kupfer_cmd = ['wrapper_su_helper', '--uid', str(config.runtime.uid), '--username', 'kupfer', '--'] + kupfer_cmd
|
||||||
|
|
||||||
|
|
|
@ -31,15 +31,17 @@ class Wrapper(Protocol):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
class BaseWrapper(Wrapper):
|
class Wrapper(WrapperProtocol):
|
||||||
uuid: str
|
uuid: str
|
||||||
identifier: str
|
identifier: str
|
||||||
type: str
|
type: str
|
||||||
wrapped_config_path: str
|
wrapped_config_path: str
|
||||||
|
argv_override: Optional[list[str]]
|
||||||
|
|
||||||
def __init__(self, random_id: Optional[str] = None, name: Optional[str] = None):
|
def __init__(self, random_id: Optional[str] = None, name: Optional[str] = None):
|
||||||
self.uuid = str(random_id or uuid.uuid4())
|
self.uuid = str(random_id or uuid.uuid4())
|
||||||
self.identifier = name or f'kupferbootstrap-{self.uuid}'
|
self.identifier = name or f'kupferbootstrap-{self.uuid}'
|
||||||
|
self.argv_override = None
|
||||||
|
|
||||||
def filter_args_wrapper(self, args):
|
def filter_args_wrapper(self, args):
|
||||||
"""filter out -c/--config since it doesn't apply in wrapper"""
|
"""filter out -c/--config since it doesn't apply in wrapper"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue