Skip to content
Snippets Groups Projects
Commit 8d0b44e9 authored by Martin Mareš's avatar Martin Mareš
Browse files

Add podman_create_options to container config

parent eff16c69
No related branches found
No related tags found
No related merge requests found
kam-shipcat (0.9.1) unstable; urgency=medium
* Added podman_create_options.
-- Martin Mares <mj@ucw.cz> Tue, 18 Jun 2024 10:46:23 +0200
kam-shipcat (0.9) unstable; urgency=medium
* Initial release.
......
......@@ -12,3 +12,6 @@ allowed_groups = []
# Do we re-create the container on every start?
create_on_start = false
# Extra options passed to "podman create"
podman_create_options = []
......@@ -6,7 +6,7 @@ from grp import getgrnam
from pathlib import Path
import re
import tomllib
from typing import Set
from typing import Set, List
from .json_walker import Walker, WalkerError
......@@ -58,6 +58,7 @@ class ContainerConfig:
allowed_groups: Set[int]
create_on_start: bool
global_config: GlobalConfig
podman_create_options: List[str]
# Automatically generated
pid_file: str
......@@ -118,6 +119,7 @@ class ContainerConfig:
self.allowed_groups.add(grp.gr_gid)
self.create_on_start = w['create_on_start'].as_bool(self.global_config.default_create_on_start)
self.podman_create_options = [o.as_str() for o in w['podman_create_options'].default_to([]).array_values()]
self.pid_file = f'/run/shc/{self.name}.pid'
self.user_name = self.name
......
......@@ -226,8 +226,7 @@ def create_container(cc: ContainerConfig) -> None:
'--ip', ip,
'--subuidname', cc.user_name,
'--subgidname', cc.user_name,
cc.image,
],
] + cc.podman_create_options + [cc.image]
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment