diff --git a/controllers/serviceintegration_controller.go b/controllers/serviceintegration_controller.go index 0c69c1db..970af608 100644 --- a/controllers/serviceintegration_controller.go +++ b/controllers/serviceintegration_controller.go @@ -136,7 +136,7 @@ func (h ServiceIntegrationHandler) delete(ctx context.Context, avn *aiven.Client } err = avnGen.ServiceIntegrationDelete(ctx, si.Spec.Project, si.Status.ID) - if avngen.OmitNotFound(err) != nil { + if err != nil && !isNotFound(err) { return false, fmt.Errorf("aiven client delete service integration error: %w", err) } diff --git a/controllers/serviceintegrationendpoint_controller.go b/controllers/serviceintegrationendpoint_controller.go index 827602fa..6143d5c1 100644 --- a/controllers/serviceintegrationendpoint_controller.go +++ b/controllers/serviceintegrationendpoint_controller.go @@ -134,7 +134,7 @@ func (h ServiceIntegrationEndpointHandler) delete(ctx context.Context, avn *aive } err = avnGen.ServiceIntegrationEndpointDelete(ctx, si.Spec.Project, si.Status.ID) - if avngen.OmitNotFound(err) != nil { + if err != nil && !isNotFound(err) { return false, fmt.Errorf("aiven client delete service integration endpoint error: %w", err) } diff --git a/sweeper/service_integrations.go b/sweeper/service_integrations.go index 81a5c0db..9a192973 100644 --- a/sweeper/service_integrations.go +++ b/sweeper/service_integrations.go @@ -23,7 +23,8 @@ func (sweeper *serviceIntegrationEndpointsSweeper) Sweep(ctx context.Context, pr } for _, s := range endpoints { - if err := sweeper.client.ServiceIntegrationEndpointDelete(ctx, projectName, s.EndpointId); avngen.OmitNotFound(err) != nil { + err := sweeper.client.ServiceIntegrationEndpointDelete(ctx, projectName, s.EndpointId) + if err != nil && !avngen.IsNotFound(err) { return fmt.Errorf("error deleting service integration endpoint %q: %w", s.EndpointName, err) } } diff --git a/sweeper/services.go b/sweeper/services.go index 35e73f0b..db01d78c 100644 --- a/sweeper/services.go +++ b/sweeper/services.go @@ -43,7 +43,8 @@ func (sweeper *servicesSweeper) Sweep(ctx context.Context, projectName string) e } } - if err := sweeper.client.ServiceDelete(ctx, projectName, s.ServiceName); avngen.OmitNotFound(err) != nil { + err := sweeper.client.ServiceDelete(ctx, projectName, s.ServiceName) + if err != nil && !avngen.IsNotFound(err) { return fmt.Errorf("error deleting service %s: %w", s.ServiceName, err) } }