deprecate container restart

This commit is contained in:
2026-01-01 18:10:38 -08:00
parent f3bdabc3cd
commit 2d078648c2

View File

@@ -145,7 +145,7 @@ class Composer:
"""Sets the running status of the compose stack """Sets the running status of the compose stack
Args: Args:
status: string containing "up", "down", "restart", or "recreate" corresponding to the respective running state of the composer status: string containing "up", "down", or "recreate" corresponding to the respective running state of the composer
""" """
try: try:
@@ -160,10 +160,6 @@ class Composer:
self.docker.compose.down( self.docker.compose.down(
services=[self.name] services=[self.name]
) )
elif status == "restart":
self.docker.compose.restart(
services=[self.name]
)
elif status == "recreate": elif status == "recreate":
self.docker.compose.up( self.docker.compose.up(
build=True, build=True,
@@ -173,7 +169,7 @@ class Composer:
remove_orphans=True remove_orphans=True
) )
else: else:
logger.warn(f"Undefined status {status} - use up, down, or restart") logger.warn(f"Undefined status {status} - use up, down, or recreate")
except DockerException as error: except DockerException as error:
logger.error(f"Setting status of composer failed: {error}") logger.error(f"Setting status of composer failed: {error}")
@@ -248,7 +244,7 @@ class Service:
"""Sets the running status of the service """Sets the running status of the service
Args: Args:
status: string containing "up", "down", "restart", or "recreate" corresponding to the respective running state of the service status: string containing "up", "down", or "recreate" corresponding to the respective running state of the service
""" """
try: try:
@@ -264,10 +260,6 @@ class Service:
self.parent.docker.compose.down( self.parent.docker.compose.down(
services=[self.name] services=[self.name]
) )
elif status == "restart":
self.parent.docker.compose.restart(
services=[self.name]
)
elif status == "recreate": elif status == "recreate":
self.parent.docker.compose.up( self.parent.docker.compose.up(
build=True, build=True,
@@ -278,7 +270,7 @@ class Service:
remove_orphans=True remove_orphans=True
) )
else: else:
logger.warn(f"Undefined status {status} - use up, down, or restart") logger.warn(f"Undefined status {status} - use up, down, or recreate")
except DockerException as error: except DockerException as error:
logger.error(f"Setting status for service {self.name} failed: {error}") logger.error(f"Setting status for service {self.name} failed: {error}")