diff --git a/pkg/client/deploy/operation/container.go b/pkg/client/deploy/operation/container.go index 90ae2468..90be5ccd 100644 --- a/pkg/client/deploy/operation/container.go +++ b/pkg/client/deploy/operation/container.go @@ -116,7 +116,7 @@ func (o *ReplaceContainerOperation) Execute(ctx context.Context, cli Client) err } } - // TODO: Rollback support - if new container fails to start, restart old container (#24) + // TODO: Rollback support - if new container fails to start, stop new, collect logs, and restart old container (#24) // TODO: When parallelism is added, rollback becomes more complex - need to track which containers // were stopped and restore them all on failure resp, err := cli.CreateContainer(ctx, o.ServiceID, o.Spec, o.MachineID) @@ -127,6 +127,8 @@ func (o *ReplaceContainerOperation) Execute(ctx context.Context, cli Client) err return fmt.Errorf("start container: %w", err) } + // TODO: wait for the container to become healthy. If unhealthy, stop new container, collect logs, and start old. + // For start-first, we need to stop before removing. // For stop-first, the container is already stopped. if !stopFirst {