feat(pre-deploy): add support for pre-deploy hook containers in service management, sync *all* containers to store

This commit is contained in:
Pasha Sviderski
2026-04-08 19:16:28 +10:00
parent cef047221c
commit 1c8b77054a
11 changed files with 508 additions and 298 deletions
+5 -1
View File
@@ -152,12 +152,16 @@ func (c *Controller) syncContainersToStore(ctx context.Context) error {
return fmt.Errorf("list containers from store: %w", err)
}
containers, err := c.service.ListServiceContainers(ctx, "", container.ListOptions{})
// List containers for all services, including stopped ones and deployment hooks.
result, err := c.service.ListServiceContainers(ctx, "", container.ListOptions{All: true})
if err != nil {
// TODO: mark all containers as outdated in the store.
return fmt.Errorf("list service containers: %w", err)
}
// Sync both regular and one-off hook containers to the store.
containers := append(result.Containers, result.HookContainers...)
// Delete containers from the store that are no longer present in the Docker daemon.
var deleteIDs []string
for _, sc := range storeContainers {