diff --git a/pkg/sync/manager/controller.go b/pkg/sync/manager/controller.go index b600dcd..9317764 100644 --- a/pkg/sync/manager/controller.go +++ b/pkg/sync/manager/controller.go @@ -103,9 +103,7 @@ func (c *SyncController) Reconcile(ctx context.Context, req ctrl.Request) (ctrl. c.ResourceParser.SetBuffer(initialData) for _, res := range instance.Spec.WatchedResources { - var err error - err = c.ResourceParser.Parse(ctx, res) - if err != nil { + if err = c.ResourceParser.Parse(ctx, res); err != nil { log.Error(err, "failed to parse resource", "resource", res) errList = append(errList, err) } diff --git a/pkg/sync/parser/parser.go b/pkg/sync/parser/parser.go index aa88af7..ab656ed 100644 --- a/pkg/sync/parser/parser.go +++ b/pkg/sync/parser/parser.go @@ -15,7 +15,6 @@ package parser import ( "context" "encoding/json" - "errors" "fmt" v1 "github.com/adobe/cluster-registry/pkg/api/registry/v1" registryv1alpha1 "github.com/adobe/cluster-registry/pkg/api/registry/v1alpha1" @@ -60,7 +59,7 @@ func (p *ResourceParser) Parse(ctx context.Context, res registryv1alpha1.Watched h, ok := p.handlers[gvk] if !ok { - return errors.New(fmt.Sprintf("no handler registered for GVK: %s", gvk.String())) + return fmt.Errorf("no handler registered for GVK: %s", gvk.String()) } objects, err := p.getObjectsForResource(ctx, res)