Skip to content

Commit

Permalink
fix nilaway lint
Browse files Browse the repository at this point in the history
Signed-off-by: Artem Bortnikov <artem.bortnikov@telekom.com>
  • Loading branch information
aobort committed Apr 25, 2024
1 parent c9f9c45 commit 6cf51c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/controller/factory/builders.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ import (
)

func reconcileOwnedResource(ctx context.Context, c client.Client, resource client.Object) error {
if resource == nil {
return fmt.Errorf("resource cannot be nil")
}
gvk, err := apiutil.GVKForObject(resource, c.Scheme())
if err != nil {
return err
return fmt.Errorf("failed to get GVK: %w", err)
}
logger := log.FromContext(ctx).WithValues("group", gvk.GroupVersion().String(), "kind", gvk.Kind, "name", resource.GetName())
logger.V(2).Info("reconciling owned resource")
Expand Down

0 comments on commit 6cf51c5

Please sign in to comment.