chore: add TODO for ReplaceContainerOperation

This commit is contained in:
Pasha Sviderski
2026-02-24 15:30:23 +10:00
parent 93d7f29d31
commit f8d1945544
+3 -1
View File
@@ -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 // TODO: When parallelism is added, rollback becomes more complex - need to track which containers
// were stopped and restore them all on failure // were stopped and restore them all on failure
resp, err := cli.CreateContainer(ctx, o.ServiceID, o.Spec, o.MachineID) 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) 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 start-first, we need to stop before removing.
// For stop-first, the container is already stopped. // For stop-first, the container is already stopped.
if !stopFirst { if !stopFirst {