mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +00:00
update kube-proxy
This commit is contained in:
parent
ddfc4d3e58
commit
e340a07ccf
@ -573,7 +573,7 @@ func (s *ProxyServer) Run(ctx context.Context) error {
|
||||
go endpointSliceConfig.Run(ctx.Done())
|
||||
|
||||
if utilfeature.DefaultFeatureGate.Enabled(features.MultiCIDRServiceAllocator) {
|
||||
serviceCIDRConfig := config.NewServiceCIDRConfig(ctx, informerFactory.Networking().V1beta1().ServiceCIDRs(), s.Config.ConfigSyncPeriod.Duration)
|
||||
serviceCIDRConfig := config.NewServiceCIDRConfig(ctx, informerFactory.Networking().V1().ServiceCIDRs(), s.Config.ConfigSyncPeriod.Duration)
|
||||
serviceCIDRConfig.RegisterEventHandler(s.Proxier)
|
||||
go serviceCIDRConfig.Run(wait.NeverStop)
|
||||
}
|
||||
|
@ -24,12 +24,12 @@ import (
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
discoveryv1 "k8s.io/api/discovery/v1"
|
||||
networkingv1beta1 "k8s.io/api/networking/v1beta1"
|
||||
networkingv1 "k8s.io/api/networking/v1"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
v1informers "k8s.io/client-go/informers/core/v1"
|
||||
discoveryv1informers "k8s.io/client-go/informers/discovery/v1"
|
||||
networkingv1beta1informers "k8s.io/client-go/informers/networking/v1beta1"
|
||||
networkingv1informers "k8s.io/client-go/informers/networking/v1"
|
||||
"k8s.io/client-go/tools/cache"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
@ -404,7 +404,7 @@ type ServiceCIDRConfig struct {
|
||||
}
|
||||
|
||||
// NewServiceCIDRConfig creates a new ServiceCIDRConfig.
|
||||
func NewServiceCIDRConfig(ctx context.Context, serviceCIDRInformer networkingv1beta1informers.ServiceCIDRInformer, resyncPeriod time.Duration) *ServiceCIDRConfig {
|
||||
func NewServiceCIDRConfig(ctx context.Context, serviceCIDRInformer networkingv1informers.ServiceCIDRInformer, resyncPeriod time.Duration) *ServiceCIDRConfig {
|
||||
result := &ServiceCIDRConfig{
|
||||
cidrs: sets.New[string](),
|
||||
logger: klog.FromContext(ctx),
|
||||
@ -448,11 +448,11 @@ func (c *ServiceCIDRConfig) Run(stopCh <-chan struct{}) {
|
||||
// handleServiceCIDREvent is a helper function to handle Add, Update and Delete
|
||||
// events on ServiceCIDR objects and call downstream event handlers.
|
||||
func (c *ServiceCIDRConfig) handleServiceCIDREvent(oldObj, newObj interface{}) {
|
||||
var oldServiceCIDR, newServiceCIDR *networkingv1beta1.ServiceCIDR
|
||||
var oldServiceCIDR, newServiceCIDR *networkingv1.ServiceCIDR
|
||||
var ok bool
|
||||
|
||||
if oldObj != nil {
|
||||
oldServiceCIDR, ok = oldObj.(*networkingv1beta1.ServiceCIDR)
|
||||
oldServiceCIDR, ok = oldObj.(*networkingv1.ServiceCIDR)
|
||||
if !ok {
|
||||
utilruntime.HandleError(fmt.Errorf("unexpected object type: %v", oldObj))
|
||||
return
|
||||
@ -460,7 +460,7 @@ func (c *ServiceCIDRConfig) handleServiceCIDREvent(oldObj, newObj interface{}) {
|
||||
}
|
||||
|
||||
if newObj != nil {
|
||||
newServiceCIDR, ok = newObj.(*networkingv1beta1.ServiceCIDR)
|
||||
newServiceCIDR, ok = newObj.(*networkingv1.ServiceCIDR)
|
||||
if !ok {
|
||||
utilruntime.HandleError(fmt.Errorf("unexpected object type: %v", newObj))
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user