Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
aalexand committed Jul 11, 2024
1 parent 4dca53e commit 7785050
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions pkg/sync/manager/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/sync/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 7785050

Please sign in to comment.