diff --git a/changelog/CHANGELOG.md b/changelog/CHANGELOG.md new file mode 100644 index 0000000000000..071d854e9df08 --- /dev/null +++ b/changelog/CHANGELOG.md @@ -0,0 +1,7 @@ +### Event reporter v2.0.2 + +* Fix: app events with manifest generation error (non-existed path, repo, project, etc.) not reported to codefresh + +### Argocd Server (built-in event-reporter) + +* Fix: app events with manifest generation error (non-existed path, repo, project, etc.) not reported to codefresh \ No newline at end of file diff --git a/event_reporter/reporter/application_event_reporter.go b/event_reporter/reporter/application_event_reporter.go index 01a647a9caf8b..3dfd8df48f9fd 100644 --- a/event_reporter/reporter/application_event_reporter.go +++ b/event_reporter/reporter/application_event_reporter.go @@ -124,20 +124,6 @@ func (r *applicationEventReporter) getDesiredManifests(ctx context.Context, a *a Revision: &a.Status.Sync.Revision, }) if err != nil { - notManifestGenerationError := !strings.Contains(err.Error(), "Manifest generation error") - - // we can ignore the error - notAppPathDoesntExistsError := !strings.Contains(err.Error(), "app path does not exist") - - wrongDestinationError := !strings.Contains(err.Error(), "error validating destination") - - // when application deleted rbac also throws erorr with PermissionDenied - // we can ignore the error, as we check rbac access before reporting events - notPermissionDeniedError := !strings.Contains(err.Error(), "PermissionDenied") - - if notManifestGenerationError && notPermissionDeniedError && notAppPathDoesntExistsError && wrongDestinationError { - return nil, fmt.Errorf("failed to get application desired state manifests: %w", err), false - } // if it's manifest generation error we need to still report the actual state // of the resources, but since we can't get the desired state, we will report // each resource with empty desired state diff --git a/server/application/application_event_reporter.go b/server/application/application_event_reporter.go index fc0a918a328e8..2786b0c4b9478 100644 --- a/server/application/application_event_reporter.go +++ b/server/application/application_event_reporter.go @@ -88,18 +88,6 @@ func (s *applicationEventReporter) getDesiredManifests(ctx context.Context, a *a Revision: &a.Status.Sync.Revision, }) if err != nil { - notManifestGenerationError := !strings.Contains(err.Error(), "Manifest generation error") - - // we can ignore the error - notAppPathDoesntExistsError := !strings.Contains(err.Error(), "app path does not exist") - - // when application deleted rbac also throws erorr with PermissionDenied - // we can ignore the error, as we check rbac access before reporting events - notPermissionDeniedError := !strings.Contains(err.Error(), "PermissionDenied") - - if notManifestGenerationError && notPermissionDeniedError && notAppPathDoesntExistsError { - return nil, fmt.Errorf("failed to get application desired state manifests: %w", err), false - } // if it's manifest generation error we need to still report the actual state // of the resources, but since we can't get the desired state, we will report // each resource with empty desired state