...

Source file src/k8s.io/kubernetes/cmd/kube-proxy/app/server_other.go

Documentation: k8s.io/kubernetes/cmd/kube-proxy/app

     1  //go:build !windows && !linux
     2  // +build !windows,!linux
     3  
     4  /*
     5  Copyright 2024 The Kubernetes Authors.
     6  
     7  Licensed under the Apache License, Version 2.0 (the "License");
     8  you may not use this file except in compliance with the License.
     9  You may obtain a copy of the License at
    10  
    11      http://www.apache.org/licenses/LICENSE-2.0
    12  
    13  Unless required by applicable law or agreed to in writing, software
    14  distributed under the License is distributed on an "AS IS" BASIS,
    15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    16  See the License for the specific language governing permissions and
    17  limitations under the License.
    18  */
    19  
    20  // Package app does all of the work necessary to configure and run a
    21  // Kubernetes app process.
    22  package app
    23  
    24  import (
    25  	"fmt"
    26  	"runtime"
    27  
    28  	"k8s.io/kubernetes/pkg/proxy"
    29  	proxyconfigapi "k8s.io/kubernetes/pkg/proxy/apis/config"
    30  )
    31  
    32  // platformApplyDefaults is called after parsing command-line flags and/or reading the
    33  // config file, to apply platform-specific default values to config.
    34  func (o *Options) platformApplyDefaults(config *proxyconfigapi.KubeProxyConfiguration) {
    35  }
    36  
    37  var unsupportedError = fmt.Errorf(runtime.GOOS + "/" + runtime.GOARCH + "is unsupported")
    38  
    39  // platformSetup is called after setting up the ProxyServer, but before creating the
    40  // Proxier. It should fill in any platform-specific fields and perform other
    41  // platform-specific setup.
    42  func (s *ProxyServer) platformSetup() error {
    43  	return unsupportedError
    44  }
    45  
    46  // platformCheckSupported is called immediately before creating the Proxier, to check
    47  // what IP families are supported (and whether the configuration is usable at all).
    48  func (s *ProxyServer) platformCheckSupported() (ipv4Supported, ipv6Supported, dualStackSupported bool, err error) {
    49  	return false, false, false, unsupportedError
    50  }
    51  
    52  // createProxier creates the proxy.Provider
    53  func (s *ProxyServer) createProxier(config *proxyconfigapi.KubeProxyConfiguration, dualStackMode, initOnly bool) (proxy.Provider, error) {
    54  	return nil, unsupportedError
    55  }
    56  
    57  // platformCleanup removes stale kube-proxy rules that can be safely removed.
    58  func platformCleanup(mode proxyconfigapi.ProxyMode, cleanupAndExit bool) error {
    59  	return unsupportedError
    60  }
    61  

View as plain text