mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-10-31 13:50:01 +00:00 
			
		
		
		
	Merge pull request #105450 from danwinship/ipvs-dead-code
Remove some dead code in the ipvs proxy
This commit is contained in:
		| @@ -31,12 +31,10 @@ import ( | ||||
| 	libipvs "github.com/moby/ipvs" | ||||
|  | ||||
| 	"k8s.io/klog/v2" | ||||
| 	utilexec "k8s.io/utils/exec" | ||||
| ) | ||||
|  | ||||
| // runner implements ipvs.Interface. | ||||
| type runner struct { | ||||
| 	exec       utilexec.Interface | ||||
| 	ipvsHandle *libipvs.Handle | ||||
| 	mu         sync.Mutex // Protect Netlink calls | ||||
| } | ||||
| @@ -45,14 +43,13 @@ type runner struct { | ||||
| type Protocol uint16 | ||||
|  | ||||
| // New returns a new Interface which will call ipvs APIs. | ||||
| func New(exec utilexec.Interface) Interface { | ||||
| func New() Interface { | ||||
| 	handle, err := libipvs.New("") | ||||
| 	if err != nil { | ||||
| 		klog.Errorf("IPVS interface can't be initialized, error: %v", err) | ||||
| 		return nil | ||||
| 	} | ||||
| 	return &runner{ | ||||
| 		exec:       exec, | ||||
| 		ipvsHandle: handle, | ||||
| 	} | ||||
| } | ||||
|   | ||||
| @@ -22,12 +22,10 @@ package ipvs | ||||
| import ( | ||||
| 	"fmt" | ||||
| 	"time" | ||||
|  | ||||
| 	utilexec "k8s.io/utils/exec" | ||||
| ) | ||||
|  | ||||
| // New returns a dummy Interface for unsupported platform. | ||||
| func New(utilexec.Interface) Interface { | ||||
| func New() Interface { | ||||
| 	return &runner{} | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -1,40 +0,0 @@ | ||||
| //go:build !linux | ||||
| // +build !linux | ||||
|  | ||||
| /* | ||||
| Copyright 2018 The Kubernetes Authors. | ||||
|  | ||||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| you may not use this file except in compliance with the License. | ||||
| You may obtain a copy of the License at | ||||
|  | ||||
|     http://www.apache.org/licenses/LICENSE-2.0 | ||||
|  | ||||
| Unless required by applicable law or agreed to in writing, software | ||||
| distributed under the License is distributed on an "AS IS" BASIS, | ||||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| See the License for the specific language governing permissions and | ||||
| limitations under the License. | ||||
| */ | ||||
|  | ||||
| package ipvs | ||||
|  | ||||
| import ( | ||||
| 	utilsexec "k8s.io/utils/exec" | ||||
| ) | ||||
|  | ||||
| // RequiredIPVSKernelModulesAvailableCheck tests IPVS required kernel modules. | ||||
| type RequiredIPVSKernelModulesAvailableCheck struct { | ||||
| 	Executor utilsexec.Interface | ||||
| } | ||||
|  | ||||
| // Name returns label for RequiredIPVSKernelModulesAvailableCheck | ||||
| func (r RequiredIPVSKernelModulesAvailableCheck) Name() string { | ||||
| 	return "RequiredIPVSKernelModulesAvailable" | ||||
| } | ||||
|  | ||||
| // Check try to validates IPVS required kernel modules exists or not. | ||||
| func (r RequiredIPVSKernelModulesAvailableCheck) Check() (warnings, errors []error) { | ||||
|  | ||||
| 	return nil, nil | ||||
| } | ||||
		Reference in New Issue
	
	Block a user