From b35fdff50f26b48c35f798b2c29da39565c90af2 Mon Sep 17 00:00:00 2001 From: Oded Ben Ozer Date: Wed, 12 Jun 2024 11:52:25 +0200 Subject: [PATCH] Fix two "bad conflict resolution" issues --- internal/pkg/argocd/argocd.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/pkg/argocd/argocd.go b/internal/pkg/argocd/argocd.go index 00d4b4f3..63e12887 100644 --- a/internal/pkg/argocd/argocd.go +++ b/internal/pkg/argocd/argocd.go @@ -172,9 +172,8 @@ func findArgocdAppBySHA1Label(ctx context.Context, componentPath string, repo st } foundApps, err := appIf.List(ctx, &appLabelQuery) if err != nil { - log.Errorf("Error listing ArgoCD applications: %v", err) - componentDiffResult.DiffError = err - return componentDiffResult + return nil, fmt.Errorf("Error listing ArgoCD applications: %v", err) + } if len(foundApps.Items) == 0 { return nil, fmt.Errorf("No ArgoCD application found for component path sha1 %s(repo %s), used this label selector: %s", componentPathSha1, repo, labelSelector) @@ -245,7 +244,7 @@ func generateDiffOfAComponent(ctx context.Context, componentPath string, prBranc return componentDiffResult } - log.Debugf("Found ArgoCD application: %s", foundApps.Items[0].Name) + log.Debugf("Found ArgoCD application: %s", foundApp.Name) // Get the application and its resources, resources are the live state of the application objects. // The 2nd "app fetch" is needed for the "refreshTypeHArd", we don't want to do that to non-relevant apps" refreshType := string(argoappv1.RefreshTypeHard)