@@ -19,6 +19,7 @@ import (
19
19
argoio "github.com/argoproj/argo-cd/v2/util/io"
20
20
"github.com/argoproj/gitops-engine/pkg/sync/hook"
21
21
"github.com/google/go-cmp/cmp"
22
+ log "github.com/sirupsen/logrus"
22
23
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
23
24
)
24
25
@@ -185,13 +186,15 @@ func generateDiffOfAComponent(ctx context.Context, componentPath string, prBranc
185
186
app , err := appIf .Get (ctx , & appNameQuery )
186
187
if err != nil {
187
188
componentDiffResult .DiffError = err
189
+ log .Errorf ("Error getting app %s: %v" , foundApps .Items [0 ].Name , err )
188
190
return componentDiffResult
189
191
}
190
192
componentDiffResult .ArgoCdAppName = app .Name
191
193
componentDiffResult .ArgoCdAppURL = fmt .Sprintf ("%s/applications/%s" , argoSettings .URL , app .Name )
192
194
resources , err := appIf .ManagedResources (ctx , & application.ResourcesQuery {ApplicationName : & app .Name , AppNamespace : & app .Namespace })
193
195
if err != nil {
194
196
componentDiffResult .DiffError = err
197
+ log .Errorf ("Error getting (live)resources for app %s: %v" , app .Name , err )
195
198
return componentDiffResult
196
199
}
197
200
@@ -206,6 +209,7 @@ func generateDiffOfAComponent(ctx context.Context, componentPath string, prBranc
206
209
manifests , err := appIf .GetManifests (ctx , & manifestQuery )
207
210
if err != nil {
208
211
componentDiffResult .DiffError = err
212
+ log .Errorf ("Error getting manifests for app %s, revision %s: %v" , app .Name , prBranch , err )
209
213
return componentDiffResult
210
214
}
211
215
diffOption .res = manifests
@@ -215,6 +219,7 @@ func generateDiffOfAComponent(ctx context.Context, componentPath string, prBranc
215
219
detailedProject , err := projIf .GetDetailedProject (ctx , & projectpkg.ProjectQuery {Name : app .Spec .Project })
216
220
if err != nil {
217
221
componentDiffResult .DiffError = err
222
+ log .Errorf ("Error getting project %s: %v" , app .Spec .Project , err )
218
223
return componentDiffResult
219
224
}
220
225
@@ -262,6 +267,7 @@ func GenerateDiffOfChangedComponents(ctx context.Context, componentPathList []st
262
267
currentDiffResult := generateDiffOfAComponent (ctx , componentPath , prBranch , repo , appIf , projIf , argoSettings )
263
268
if currentDiffResult .DiffError != nil {
264
269
hasComponentDiffErrors = true
270
+ err = currentDiffResult .DiffError
265
271
}
266
272
if currentDiffResult .HasDiff {
267
273
hasComponentDiff = true
0 commit comments