Skip to content

Commit

Permalink
feat: not throw error in case if update revision for path failed
Browse files Browse the repository at this point in the history
  • Loading branch information
pasha-codefresh committed Oct 27, 2024
1 parent 8e77c57 commit 32d3762
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions controller/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -233,8 +235,11 @@ func (m *appStateManager) GetRepoObjs(app *v1alpha1.Application, sources []v1alp
HasMultipleSources: app.Spec.HasMultipleSources(),
})
if err != nil {

Check failure on line 237 in controller/state.go

View workflow job for this annotation

GitHub Actions / Lint Go code

unnecessary leading newline (whitespace)


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
}
Expand Down Expand Up @@ -275,7 +280,7 @@ func (m *appStateManager) GetRepoObjs(app *v1alpha1.Application, sources []v1alp
ApplicationMetadata: &app.ObjectMeta,
})
if err != nil {
return nil, nil, false, fmt.Errorf("failed to generate manifest for source %d of %d: %w", i+1, len(sources), err)
logCtx.Warnf("failed to generate manifest for source %d of %d: %v", i+1, len(sources), err)
}

targetObj, err := unmarshalManifests(manifestInfo.GetCompiledManifests())
Expand All @@ -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())
}
Expand Down

0 comments on commit 32d3762

Please sign in to comment.