Skip to content

Commit 89f9019

Browse files
committed
Small bugfix
1 parent 7a6b3f9 commit 89f9019

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

cmd/agent/app/server.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ import (
3939
"google.golang.org/grpc/credentials"
4040
"google.golang.org/grpc/keepalive"
4141
"k8s.io/apimachinery/pkg/labels"
42-
"k8s.io/client-go/informers"
4342
"k8s.io/client-go/kubernetes"
4443
"k8s.io/client-go/tools/clientcmd"
4544
"k8s.io/klog/v2"
@@ -147,20 +146,18 @@ func (a *Agent) runProxyConnection(o *options.GrpcProxyAgentOptions, drainCh, st
147146
if err != nil {
148147
return nil, fmt.Errorf("failed to create kubernetes clientset: %v", err)
149148
}
150-
sharedInformerFactory := informers.NewSharedInformerFactory(k8sClient, o.InformerResync)
151149
serverLeaseSelector, err := labels.Parse(o.ServerLeaseSelector)
152150
if err != nil {
153151
return nil, fmt.Errorf("invalid server count lease selector: %w", err)
154152
}
155153
serverLeaseCounter := agent.NewServerLeaseCounter(
156-
sharedInformerFactory,
154+
k8sClient,
157155
serverLeaseSelector,
158156
)
159157
if err != nil {
160158
return nil, fmt.Errorf("failed to create server lease counter: %w", err)
161159
}
162160
cc.ServerLeaseCounter = serverLeaseCounter
163-
sharedInformerFactory.Start(context.Background().Done())
164161
}
165162

166163
cs := cc.NewAgentClientSet(drainCh, stopCh)

0 commit comments

Comments
 (0)