Skip to content

Commit

Permalink
Add the app conditions error to diff comment
Browse files Browse the repository at this point in the history
  • Loading branch information
yzdann committed Sep 4, 2024
1 parent 9ab1dd8 commit 2917f71
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion internal/pkg/argocd/argocd.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,19 @@ func generateArgocdAppDiff(ctx context.Context, keepDiffData bool, app *argoappv
if err != nil {
return false, nil, fmt.Errorf("Failed to group objects by key: %w", err)
}

cerr := ""
if app.Status.Conditions != nil {
for _, condition := range app.Status.Conditions {
if condition.Type == argoappv1.ApplicationConditionComparisonError {
// let the last one win for now as we are testing only
cerr = condition.Message
}
}
}
items, err = groupObjsForDiff(resources, groupedObjs, items, argoSettings, app.InstanceName(argoSettings.ControllerNamespace), app.Spec.Destination.Namespace)
if err != nil {
return false, nil, fmt.Errorf("Failed to group objects for diff: %w", err)
return false, nil, fmt.Errorf("%s\nFailed to group objects for diff: %w", cerr, err)
}

for _, item := range items {
Expand Down

0 comments on commit 2917f71

Please sign in to comment.