(ctx context.Context, ch *cmdutil.Helper, app *local.App, outputFormat printer.Format, outputFile string)
| 149 | } |
| 150 | |
| 151 | func reconcileAndReport(ctx context.Context, ch *cmdutil.Helper, app *local.App, outputFormat printer.Format, outputFile string) error { |
| 152 | ctrl, err := app.Runtime.Controller(ctx, app.Instance.ID) |
| 153 | if err != nil { |
| 154 | return err |
| 155 | } |
| 156 | |
| 157 | // Kick off reconciliation and wait for completion |
| 158 | if err := ctrl.Reconcile(ctx, runtime.GlobalProjectParserName); err != nil { |
| 159 | return fmt.Errorf("failed to start reconciliation: %w", err) |
| 160 | } |
| 161 | |
| 162 | time.Sleep(3 * time.Second) // brief sleep to allow reconciliation to start |
| 163 | |
| 164 | if err := ctrl.WaitUntilIdle(ctx, true); err != nil { |
| 165 | return fmt.Errorf("failed while waiting for reconciliation to finish: %w", err) |
| 166 | } |
| 167 | |
| 168 | resources, err := ctrl.List(ctx, "", "", false) |
| 169 | if err != nil { |
| 170 | return fmt.Errorf("failed to list resources: %w", err) |
| 171 | } |
| 172 | |
| 173 | // Build validation result |
| 174 | result := buildValidationResult(resources) |
| 175 | |
| 176 | // Output the result |
| 177 | return outputResult(ch, result, outputFormat, outputFile) |
| 178 | } |
| 179 | |
| 180 | func buildValidationResult(resources []*runtimev1.Resource) *ValidationResult { |
| 181 | result := &ValidationResult{ |
no test coverage detected