diff --git a/cmd/kube-proxy/app/server.go b/cmd/kube-proxy/app/server.go index af9dd5101fe..8b6455baca2 100644 --- a/cmd/kube-proxy/app/server.go +++ b/cmd/kube-proxy/app/server.go @@ -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) } diff --git a/pkg/proxy/config/config.go b/pkg/proxy/config/config.go index 1c0e540a68b..1544ad5a7d7 100644 --- a/pkg/proxy/config/config.go +++ b/pkg/proxy/config/config.go @@ -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