Compare commits
No commits in common. "fb6aadb63cf04061308616829a9a8179529dfb27" and "62d56248dfed2b30deda4026cf3abe7eef385aec" have entirely different histories.
fb6aadb63c
...
62d56248df
2 changed files with 6 additions and 7 deletions
|
@ -382,7 +382,7 @@ class Environment:
|
|||
"""Option for podman container create."""
|
||||
if len(self.variables) == 0:
|
||||
return ""
|
||||
return f"\t--env-file={self.file} \\\n"
|
||||
return f"--env-file={self.file}"
|
||||
|
||||
def create(self) -> str:
|
||||
"""Create env file."""
|
||||
|
@ -480,12 +480,10 @@ class Network:
|
|||
return cls("", [])
|
||||
mode = maybe(val, "mode")
|
||||
options = maybe(val, "options")
|
||||
if mode is None:
|
||||
if mode is None or options is None or not isinstance(options, list):
|
||||
err = "Network configuration is missing or has malformed elements!"
|
||||
logger.log_error(err)
|
||||
return cls("", [])
|
||||
if options is None or not isinstance(options, list):
|
||||
return cls(str(mode), [])
|
||||
return cls(str(mode), options)
|
||||
|
||||
def command(self) -> str:
|
||||
|
@ -677,7 +675,7 @@ class Container:
|
|||
def create_container(self) -> str:
|
||||
"""Generate podman container create command."""
|
||||
cmd = f"# Create container {self.name}\n"
|
||||
cmd += "podman container create \\\n"
|
||||
cmd += "podman container crate \\\n"
|
||||
cmd += f"\t--name={self.name} \\\n"
|
||||
if self.privileged:
|
||||
cmd += "\t--privileged \\\n"
|
||||
|
@ -691,7 +689,8 @@ class Container:
|
|||
cmd += f"{self.network.command()}"
|
||||
cmd += f"{self.dns.command()}"
|
||||
cmd += f"{self.ports.command()}"
|
||||
cmd += f"{self.env.command()}"
|
||||
if self.env is not None:
|
||||
cmd += f"\t{self.env.command()} \\\n"
|
||||
for secret in self.secrets:
|
||||
cmd += f"\t{secret.command()} \\\n"
|
||||
for volume in self.volumes:
|
||||
|
|
|
@ -14,7 +14,7 @@ from pathlib import Path
|
|||
from container import ConfigError, Container
|
||||
from log import Log
|
||||
|
||||
GENERATE_VERSION = "0.0.9"
|
||||
GENERATE_VERSION = "0.0.8"
|
||||
HEADER = f"""#!/bin/sh
|
||||
# This script was generated by containerctl v{GENERATE_VERSION}
|
||||
# Report bugs with _this script_ to <tenno+containerctl@suij.in>
|
||||
|
|
Loading…
Add table
Reference in a new issue