Pass complete KubeProxyConfiguration to NewNodeManager

This commit is contained in:
Dan Winship 2025-12-31 07:48:11 -05:00
parent 6492838d08
commit 0af2c0a767
2 changed files with 5 additions and 3 deletions

View file

@ -217,8 +217,7 @@ func newProxyServer(ctx context.Context, config *kubeproxyconfig.KubeProxyConfig
}
// NodeManager makes an informer that selects for the node where this kube-proxy is running
s.NodeManager, err = proxy.NewNodeManager(ctx, s.Client, s.Config.ConfigSyncPeriod.Duration,
s.NodeName, s.Config.DetectLocalMode == kubeproxyconfig.LocalModeNodeCIDR)
s.NodeManager, err = proxy.NewNodeManager(ctx, s.Client, s.NodeName, s.Config)
if err != nil {
return nil, err
}

View file

@ -35,6 +35,7 @@ import (
corelisters "k8s.io/client-go/listers/core/v1"
"k8s.io/client-go/tools/cache"
"k8s.io/klog/v2"
kubeproxyconfig "k8s.io/kubernetes/pkg/proxy/apis/config"
utilnode "k8s.io/kubernetes/pkg/util/node"
)
@ -61,8 +62,10 @@ type NodeManager struct {
// NewNodeManager doesn't return any error if it failed to retrieve NodeIPs and watchPodCIDRs
// is false.
func NewNodeManager(ctx context.Context, client clientset.Interface,
resyncInterval time.Duration, nodeName string, watchPodCIDRs bool,
nodeName string, config *kubeproxyconfig.KubeProxyConfiguration,
) (*NodeManager, error) {
resyncInterval := config.ConfigSyncPeriod.Duration
watchPodCIDRs := config.DetectLocalMode == kubeproxyconfig.LocalModeNodeCIDR
return newNodeManager(ctx, client, resyncInterval, nodeName, watchPodCIDRs, os.Exit, time.Second, 30*time.Second, 5*time.Minute)
}