mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-27 19:43:34 +00:00
feat(pre-deploy): add support for pre-deploy hook containers in service management, sync *all* containers to store
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user