mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Remove some dead code in the ipvs proxy
This commit is contained in:
		@@ -108,7 +108,7 @@ func newProxyServer(
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if canUseIPVS {
 | 
						if canUseIPVS {
 | 
				
			||||||
		ipvsInterface = utilipvs.New(execer)
 | 
							ipvsInterface = utilipvs.New()
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// We omit creation of pretty much everything if we run in cleanup mode
 | 
						// We omit creation of pretty much everything if we run in cleanup mode
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,12 +31,10 @@ import (
 | 
				
			|||||||
	libipvs "github.com/moby/ipvs"
 | 
						libipvs "github.com/moby/ipvs"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"k8s.io/klog/v2"
 | 
						"k8s.io/klog/v2"
 | 
				
			||||||
	utilexec "k8s.io/utils/exec"
 | 
					 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// runner implements ipvs.Interface.
 | 
					// runner implements ipvs.Interface.
 | 
				
			||||||
type runner struct {
 | 
					type runner struct {
 | 
				
			||||||
	exec       utilexec.Interface
 | 
					 | 
				
			||||||
	ipvsHandle *libipvs.Handle
 | 
						ipvsHandle *libipvs.Handle
 | 
				
			||||||
	mu         sync.Mutex // Protect Netlink calls
 | 
						mu         sync.Mutex // Protect Netlink calls
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -45,14 +43,13 @@ type runner struct {
 | 
				
			|||||||
type Protocol uint16
 | 
					type Protocol uint16
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// New returns a new Interface which will call ipvs APIs.
 | 
					// New returns a new Interface which will call ipvs APIs.
 | 
				
			||||||
func New(exec utilexec.Interface) Interface {
 | 
					func New() Interface {
 | 
				
			||||||
	handle, err := libipvs.New("")
 | 
						handle, err := libipvs.New("")
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		klog.Errorf("IPVS interface can't be initialized, error: %v", err)
 | 
							klog.Errorf("IPVS interface can't be initialized, error: %v", err)
 | 
				
			||||||
		return nil
 | 
							return nil
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return &runner{
 | 
						return &runner{
 | 
				
			||||||
		exec:       exec,
 | 
					 | 
				
			||||||
		ipvsHandle: handle,
 | 
							ipvsHandle: handle,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,12 +22,10 @@ package ipvs
 | 
				
			|||||||
import (
 | 
					import (
 | 
				
			||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					 | 
				
			||||||
	utilexec "k8s.io/utils/exec"
 | 
					 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// New returns a dummy Interface for unsupported platform.
 | 
					// New returns a dummy Interface for unsupported platform.
 | 
				
			||||||
func New(utilexec.Interface) Interface {
 | 
					func New() Interface {
 | 
				
			||||||
	return &runner{}
 | 
						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