MCPcopy Index your code
hub / github.com/docker/cli / waitOnTasks

Function waitOnTasks

cli/command/stack/remove.go:174–194  ·  view source on GitHub ↗
(ctx context.Context, apiClient client.APIClient, namespace string)

Source from the content-addressed store, hash-verified

172}
173
174func waitOnTasks(ctx context.Context, apiClient client.APIClient, namespace string) error {
175 terminalStatesReached := 0
176 for {
177 res, err := getStackTasks(ctx, apiClient, namespace)
178 if err != nil {
179 return fmt.Errorf("failed to get tasks: %w", err)
180 }
181
182 for _, task := range res.Items {
183 if terminalState(task.Status.State) {
184 terminalStatesReached++
185 break
186 }
187 }
188
189 if terminalStatesReached == len(res.Items) {
190 break
191 }
192 }
193 return nil
194}

Callers 1

runRemoveFunction · 0.85

Calls 2

getStackTasksFunction · 0.85
terminalStateFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…