diff --git a/controller/state.go b/controller/state.go index 7ced1e7ec5ccc..3ab806f0e1e66 100644 --- a/controller/state.go +++ b/controller/state.go @@ -189,6 +189,8 @@ func (m *appStateManager) GetRepoObjs(app *v1alpha1.Application, sources []v1alp keyManifestGenerateAnnotationVal, keyManifestGenerateAnnotationExists := app.Annotations[v1alpha1.AnnotationKeyManifestGeneratePaths] + logCtx := log.WithField("application", app.QualifiedName()) + for i, source := range sources { if len(revisions) < len(sources) || revisions[i] == "" { revisions[i] = source.TargetRevision @@ -233,15 +235,18 @@ func (m *appStateManager) GetRepoObjs(app *v1alpha1.Application, sources []v1alp HasMultipleSources: app.Spec.HasMultipleSources(), }) if err != nil { - return nil, nil, false, fmt.Errorf("failed to compare revisions for source %d of %d: %w", i+1, len(sources), err) - } - if updateRevisionResult.Changes { - revisionUpdated = true + logCtx.Warnf("failed to generate manifest for source %d of %d: %v", i+1, len(sources), err) } - // Generate manifests should use same revision as updateRevisionForPaths, because HEAD revision may be different between these two calls - if updateRevisionResult.Revision != "" { - revision = updateRevisionResult.Revision + if updateRevisionResult != nil { + if updateRevisionResult.Changes { + revisionUpdated = true + } + + // Generate manifests should use same revision as updateRevisionForPaths, because HEAD revision may be different between these two calls + if updateRevisionResult.Revision != "" { + revision = updateRevisionResult.Revision + } } } else { // revisionUpdated is set to true if at least one revision is not possible to be updated, @@ -287,7 +292,7 @@ func (m *appStateManager) GetRepoObjs(app *v1alpha1.Application, sources []v1alp } ts.AddCheckpoint("unmarshal_ms") - logCtx := log.WithField("application", app.QualifiedName()) + for k, v := range ts.Timings() { logCtx = logCtx.WithField(k, v.Milliseconds()) }