(ctx context.Context, apiClient client.APIClient, namespace string)
| 172 | } |
| 173 | |
| 174 | func 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 | } |
no test coverage detected
searching dependent graphs…