mirror of
https://gitlab.com/kupfer/kupferbootstrap.git
synced 2025-02-23 13:45:45 -05:00
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',
|
||||
] + 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:
|
||||
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
|
||||
identifier: str
|
||||
type: str
|
||||
wrapped_config_path: str
|
||||
argv_override: Optional[list[str]]
|
||||
|
||||
def __init__(self, random_id: Optional[str] = None, name: Optional[str] = None):
|
||||
self.uuid = str(random_id or uuid.uuid4())
|
||||
self.identifier = name or f'kupferbootstrap-{self.uuid}'
|
||||
self.argv_override = None
|
||||
|
||||
def filter_args_wrapper(self, args):
|
||||
"""filter out -c/--config since it doesn't apply in wrapper"""
|
||||
|
|
Loading…
Add table
Reference in a new issue