@dataclass
class SubModule:
"""Represent RO Submodules."""
+
sub_module_path: str
container_path: str
class HostPath:
"""Represents a hostpath."""
+
def __init__(self, config: str, container_path: str, submodules: dict = None) -> None:
mount_path_items = config.split("-")
mount_path_items.reverse()
if submodules:
for submodule in submodules.keys():
self.sub_module_dict[submodule] = SubModule(
- sub_module_path=self.mount_path + "/" + submodule + "/" + submodules[submodule].split("/")[-1],
+ sub_module_path=self.mount_path
+ + "/"
+ + submodule
+ + "/"
+ + submodules[submodule].split("/")[-1],
container_path=submodules[submodule],
)
else:
self.container_path = container_path
self.module_name = container_path.split("/")[-1]
+
class DebugMode(Object):
"""Class to handle the debug-mode."""
logger.debug(f"adding symlink for {hostpath.config}")
if len(hostpath.sub_module_dict) > 0:
for sub_module in hostpath.sub_module_dict.keys():
- self.container.exec(["rm", "-rf", hostpath.sub_module_dict[sub_module].container_path]).wait_output()
+ self.container.exec(
+ ["rm", "-rf", hostpath.sub_module_dict[sub_module].container_path]
+ ).wait_output()
self.container.exec(
[
"ln",
def _delete_hostpath_from_statefulset(self, hostpath: HostPath, statefulset: StatefulSet):
hostpath_unmounted = False
for volume in statefulset.spec.template.spec.volumes:
-
if hostpath.config != volume.name:
continue