From 6e56154d06098c4cd9ed278d6282eab3a3215483 Mon Sep 17 00:00:00 2001 From: Woojoong Kim Date: Sat, 29 Jun 2024 21:39:47 -0700 Subject: [PATCH] fix linters --- pkg/controller/app/sidecar/injector.go | 2 +- pkg/controller/topo/manager.go | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pkg/controller/app/sidecar/injector.go b/pkg/controller/app/sidecar/injector.go index 3f456bb..4bd9107 100644 --- a/pkg/controller/app/sidecar/injector.go +++ b/pkg/controller/app/sidecar/injector.go @@ -80,7 +80,7 @@ func (i *ProxyInjector) InjectDecoder(decoder *admission.Decoder) error { } // Handle : -func (i *ProxyInjector) Handle(ctx context.Context, request admission.Request) admission.Response { +func (i *ProxyInjector) Handle(_ context.Context, request admission.Request) admission.Response { podNamespacedName := types.NamespacedName{ Namespace: request.Namespace, Name: request.Name, diff --git a/pkg/controller/topo/manager.go b/pkg/controller/topo/manager.go index 53d5086..a129db6 100644 --- a/pkg/controller/topo/manager.go +++ b/pkg/controller/topo/manager.go @@ -37,11 +37,8 @@ func AddControllers(ctx context.Context, mgr manager.Manager) error { return err } - if err := mgr.GetFieldIndexer().IndexField(ctx, &v1beta1.Relation{}, "spec.kind.name", func(rawObj client.Object) []string { + return mgr.GetFieldIndexer().IndexField(ctx, &v1beta1.Relation{}, "spec.kind.name", func(rawObj client.Object) []string { relation := rawObj.(*v1beta1.Relation) return []string{relation.Spec.Kind.Name} - }); err != nil { - return err - } - return nil + }) }