mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Add stub methods for kube-proxy on non-linux/windows
This commit is contained in:
parent
8b22cb4696
commit
d2c1a23a8a
34
cmd/kube-proxy/app/init_other.go
Normal file
34
cmd/kube-proxy/app/init_other.go
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
//go:build !windows && !linux
|
||||||
|
// +build !windows,!linux
|
||||||
|
|
||||||
|
/*
|
||||||
|
Copyright 2024 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 app
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
|
"github.com/spf13/pflag"
|
||||||
|
)
|
||||||
|
|
||||||
|
func initForOS(windowsService bool) error {
|
||||||
|
return fmt.Errorf(runtime.GOOS + "/" + runtime.GOARCH + "is unsupported")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o *Options) addOSFlags(fs *pflag.FlagSet) {
|
||||||
|
}
|
60
cmd/kube-proxy/app/server_other.go
Normal file
60
cmd/kube-proxy/app/server_other.go
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
//go:build !windows && !linux
|
||||||
|
// +build !windows,!linux
|
||||||
|
|
||||||
|
/*
|
||||||
|
Copyright 2024 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 app does all of the work necessary to configure and run a
|
||||||
|
// Kubernetes app process.
|
||||||
|
package app
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
|
"k8s.io/kubernetes/pkg/proxy"
|
||||||
|
proxyconfigapi "k8s.io/kubernetes/pkg/proxy/apis/config"
|
||||||
|
)
|
||||||
|
|
||||||
|
// platformApplyDefaults is called after parsing command-line flags and/or reading the
|
||||||
|
// config file, to apply platform-specific default values to config.
|
||||||
|
func (o *Options) platformApplyDefaults(config *proxyconfigapi.KubeProxyConfiguration) {
|
||||||
|
}
|
||||||
|
|
||||||
|
var unsupportedError = fmt.Errorf(runtime.GOOS + "/" + runtime.GOARCH + "is unsupported")
|
||||||
|
|
||||||
|
// platformSetup is called after setting up the ProxyServer, but before creating the
|
||||||
|
// Proxier. It should fill in any platform-specific fields and perform other
|
||||||
|
// platform-specific setup.
|
||||||
|
func (s *ProxyServer) platformSetup() error {
|
||||||
|
return unsupportedError
|
||||||
|
}
|
||||||
|
|
||||||
|
// platformCheckSupported is called immediately before creating the Proxier, to check
|
||||||
|
// what IP families are supported (and whether the configuration is usable at all).
|
||||||
|
func (s *ProxyServer) platformCheckSupported() (ipv4Supported, ipv6Supported, dualStackSupported bool, err error) {
|
||||||
|
return false, false, false, unsupportedError
|
||||||
|
}
|
||||||
|
|
||||||
|
// createProxier creates the proxy.Provider
|
||||||
|
func (s *ProxyServer) createProxier(config *proxyconfigapi.KubeProxyConfiguration, dualStackMode, initOnly bool) (proxy.Provider, error) {
|
||||||
|
return nil, unsupportedError
|
||||||
|
}
|
||||||
|
|
||||||
|
// platformCleanup removes stale kube-proxy rules that can be safely removed.
|
||||||
|
func platformCleanup(mode proxyconfigapi.ProxyMode, cleanupAndExit bool) error {
|
||||||
|
return unsupportedError
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user