mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	referencing ClientConnectionConfiguration from k8s.io/apimachinery/pkg/apis/config
This commit is contained in:
		@@ -170,7 +170,6 @@ API rule violation: names_match,k8s.io/kubernetes/pkg/apis/componentconfig/v1alp
 | 
				
			|||||||
API rule violation: names_match,k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/v1beta1,KubeletConfiguration,ResolverConfig
 | 
					API rule violation: names_match,k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/v1beta1,KubeletConfiguration,ResolverConfig
 | 
				
			||||||
API rule violation: names_match,k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/v1beta1,KubeletConfiguration,IPTablesMasqueradeBit
 | 
					API rule violation: names_match,k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/v1beta1,KubeletConfiguration,IPTablesMasqueradeBit
 | 
				
			||||||
API rule violation: names_match,k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/v1beta1,KubeletConfiguration,IPTablesDropBit
 | 
					API rule violation: names_match,k8s.io/kubernetes/pkg/kubelet/apis/kubeletconfig/v1beta1,KubeletConfiguration,IPTablesDropBit
 | 
				
			||||||
API rule violation: names_match,k8s.io/kubernetes/pkg/proxy/apis/config/v1alpha1,ClientConnectionConfiguration,KubeConfigFile
 | 
					 | 
				
			||||||
API rule violation: names_match,k8s.io/kubernetes/pkg/proxy/apis/config/v1alpha1,KubeProxyConfiguration,IPTables
 | 
					API rule violation: names_match,k8s.io/kubernetes/pkg/proxy/apis/config/v1alpha1,KubeProxyConfiguration,IPTables
 | 
				
			||||||
API rule violation: names_match,k8s.io/metrics/pkg/apis/custom_metrics/v1beta1,MetricValue,WindowSeconds
 | 
					API rule violation: names_match,k8s.io/metrics/pkg/apis/custom_metrics/v1beta1,MetricValue,WindowSeconds
 | 
				
			||||||
API rule violation: names_match,k8s.io/metrics/pkg/apis/external_metrics/v1beta1,ExternalMetricValue,WindowSeconds
 | 
					API rule violation: names_match,k8s.io/metrics/pkg/apis/external_metrics/v1beta1,ExternalMetricValue,WindowSeconds
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,6 +30,7 @@ import (
 | 
				
			|||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"k8s.io/api/core/v1"
 | 
						"k8s.io/api/core/v1"
 | 
				
			||||||
 | 
						apimachineryconfig "k8s.io/apimachinery/pkg/apis/config"
 | 
				
			||||||
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 | 
						metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 | 
				
			||||||
	"k8s.io/apimachinery/pkg/runtime"
 | 
						"k8s.io/apimachinery/pkg/runtime"
 | 
				
			||||||
	"k8s.io/apimachinery/pkg/runtime/serializer"
 | 
						"k8s.io/apimachinery/pkg/runtime/serializer"
 | 
				
			||||||
@@ -138,7 +139,7 @@ func (o *Options) AddFlags(fs *pflag.FlagSet) {
 | 
				
			|||||||
	fs.Int32Var(o.config.OOMScoreAdj, "oom-score-adj", utilpointer.Int32PtrDerefOr(o.config.OOMScoreAdj, int32(qos.KubeProxyOOMScoreAdj)), "The oom-score-adj value for kube-proxy process. Values must be within the range [-1000, 1000]")
 | 
						fs.Int32Var(o.config.OOMScoreAdj, "oom-score-adj", utilpointer.Int32PtrDerefOr(o.config.OOMScoreAdj, int32(qos.KubeProxyOOMScoreAdj)), "The oom-score-adj value for kube-proxy process. Values must be within the range [-1000, 1000]")
 | 
				
			||||||
	fs.StringVar(&o.config.ResourceContainer, "resource-container", o.config.ResourceContainer, "Absolute name of the resource-only container to create and run the Kube-proxy in (Default: /kube-proxy).")
 | 
						fs.StringVar(&o.config.ResourceContainer, "resource-container", o.config.ResourceContainer, "Absolute name of the resource-only container to create and run the Kube-proxy in (Default: /kube-proxy).")
 | 
				
			||||||
	fs.MarkDeprecated("resource-container", "This feature will be removed in a later release.")
 | 
						fs.MarkDeprecated("resource-container", "This feature will be removed in a later release.")
 | 
				
			||||||
	fs.StringVar(&o.config.ClientConnection.KubeConfigFile, "kubeconfig", o.config.ClientConnection.KubeConfigFile, "Path to kubeconfig file with authorization information (the master location is set by the master flag).")
 | 
						fs.StringVar(&o.config.ClientConnection.Kubeconfig, "kubeconfig", o.config.ClientConnection.Kubeconfig, "Path to kubeconfig file with authorization information (the master location is set by the master flag).")
 | 
				
			||||||
	fs.Var(componentconfig.PortRangeVar{Val: &o.config.PortRange}, "proxy-port-range", "Range of host ports (beginPort-endPort, single port or beginPort+offset, inclusive) that may be consumed in order to proxy service traffic. If (unspecified, 0, or 0-0) then ports will be randomly chosen.")
 | 
						fs.Var(componentconfig.PortRangeVar{Val: &o.config.PortRange}, "proxy-port-range", "Range of host ports (beginPort-endPort, single port or beginPort+offset, inclusive) that may be consumed in order to proxy service traffic. If (unspecified, 0, or 0-0) then ports will be randomly chosen.")
 | 
				
			||||||
	fs.StringVar(&o.config.HostnameOverride, "hostname-override", o.config.HostnameOverride, "If non-empty, will use this string as identification instead of the actual hostname.")
 | 
						fs.StringVar(&o.config.HostnameOverride, "hostname-override", o.config.HostnameOverride, "If non-empty, will use this string as identification instead of the actual hostname.")
 | 
				
			||||||
	fs.Var(&o.config.Mode, "proxy-mode", "Which proxy mode to use: 'userspace' (older) or 'iptables' (faster) or 'ipvs' (experimental). If blank, use the best-available proxy (currently iptables).  If the iptables proxy is selected, regardless of how, but the system's kernel or iptables versions are insufficient, this always falls back to the userspace proxy.")
 | 
						fs.Var(&o.config.Mode, "proxy-mode", "Which proxy mode to use: 'userspace' (older) or 'iptables' (faster) or 'ipvs' (experimental). If blank, use the best-available proxy (currently iptables).  If the iptables proxy is selected, regardless of how, but the system's kernel or iptables versions are insufficient, this always falls back to the userspace proxy.")
 | 
				
			||||||
@@ -404,18 +405,18 @@ type ProxyServer struct {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// createClients creates a kube client and an event client from the given config and masterOverride.
 | 
					// createClients creates a kube client and an event client from the given config and masterOverride.
 | 
				
			||||||
// TODO remove masterOverride when CLI flags are removed.
 | 
					// TODO remove masterOverride when CLI flags are removed.
 | 
				
			||||||
func createClients(config kubeproxyconfig.ClientConnectionConfiguration, masterOverride string) (clientset.Interface, v1core.EventsGetter, error) {
 | 
					func createClients(config apimachineryconfig.ClientConnectionConfiguration, masterOverride string) (clientset.Interface, v1core.EventsGetter, error) {
 | 
				
			||||||
	var kubeConfig *rest.Config
 | 
						var kubeConfig *rest.Config
 | 
				
			||||||
	var err error
 | 
						var err error
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if len(config.KubeConfigFile) == 0 && len(masterOverride) == 0 {
 | 
						if len(config.Kubeconfig) == 0 && len(masterOverride) == 0 {
 | 
				
			||||||
		glog.Info("Neither kubeconfig file nor master URL was specified. Falling back to in-cluster config.")
 | 
							glog.Info("Neither kubeconfig file nor master URL was specified. Falling back to in-cluster config.")
 | 
				
			||||||
		kubeConfig, err = rest.InClusterConfig()
 | 
							kubeConfig, err = rest.InClusterConfig()
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		// This creates a client, first loading any specified kubeconfig
 | 
							// This creates a client, first loading any specified kubeconfig
 | 
				
			||||||
		// file, and then overriding the Master flag, if non-empty.
 | 
							// file, and then overriding the Master flag, if non-empty.
 | 
				
			||||||
		kubeConfig, err = clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
 | 
							kubeConfig, err = clientcmd.NewNonInteractiveDeferredLoadingClientConfig(
 | 
				
			||||||
			&clientcmd.ClientConfigLoadingRules{ExplicitPath: config.KubeConfigFile},
 | 
								&clientcmd.ClientConfigLoadingRules{ExplicitPath: config.Kubeconfig},
 | 
				
			||||||
			&clientcmd.ConfigOverrides{ClusterInfo: clientcmdapi.Cluster{Server: masterOverride}}).ClientConfig()
 | 
								&clientcmd.ConfigOverrides{ClusterInfo: clientcmdapi.Cluster{Server: masterOverride}}).ClientConfig()
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -26,6 +26,7 @@ import (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	"github.com/stretchr/testify/assert"
 | 
						"github.com/stretchr/testify/assert"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						apimachineryconfig "k8s.io/apimachinery/pkg/apis/config"
 | 
				
			||||||
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 | 
						metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 | 
				
			||||||
	"k8s.io/apimachinery/pkg/util/diff"
 | 
						"k8s.io/apimachinery/pkg/util/diff"
 | 
				
			||||||
	api "k8s.io/kubernetes/pkg/apis/core"
 | 
						api "k8s.io/kubernetes/pkg/apis/core"
 | 
				
			||||||
@@ -288,11 +289,11 @@ nodePortAddresses:
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		expected := &kubeproxyconfig.KubeProxyConfiguration{
 | 
							expected := &kubeproxyconfig.KubeProxyConfiguration{
 | 
				
			||||||
			BindAddress: expBindAddr,
 | 
								BindAddress: expBindAddr,
 | 
				
			||||||
			ClientConnection: kubeproxyconfig.ClientConnectionConfiguration{
 | 
								ClientConnection: apimachineryconfig.ClientConnectionConfiguration{
 | 
				
			||||||
				AcceptContentTypes: "abc",
 | 
									AcceptContentTypes: "abc",
 | 
				
			||||||
				Burst:              100,
 | 
									Burst:              100,
 | 
				
			||||||
				ContentType:        "content-type",
 | 
									ContentType:        "content-type",
 | 
				
			||||||
				KubeConfigFile:     "/path/to/kubeconfig",
 | 
									Kubeconfig:         "/path/to/kubeconfig",
 | 
				
			||||||
				QPS:                7,
 | 
									QPS:                7,
 | 
				
			||||||
			},
 | 
								},
 | 
				
			||||||
			ClusterCIDR:      tc.clusterCIDR,
 | 
								ClusterCIDR:      tc.clusterCIDR,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -136,8 +136,8 @@ func SetDefaults_ProxyConfiguration(obj *InitConfiguration) {
 | 
				
			|||||||
		obj.KubeProxy.Config.ClusterCIDR = obj.Networking.PodSubnet
 | 
							obj.KubeProxy.Config.ClusterCIDR = obj.Networking.PodSubnet
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if obj.KubeProxy.Config.ClientConnection.KubeConfigFile == "" {
 | 
						if obj.KubeProxy.Config.ClientConnection.Kubeconfig == "" {
 | 
				
			||||||
		obj.KubeProxy.Config.ClientConnection.KubeConfigFile = KubeproxyKubeConfigFileName
 | 
							obj.KubeProxy.Config.ClientConnection.Kubeconfig = KubeproxyKubeConfigFileName
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	kubeproxyscheme.Scheme.Default(obj.KubeProxy.Config)
 | 
						kubeproxyscheme.Scheme.Default(obj.KubeProxy.Config)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -66,8 +66,8 @@ func defaultKubeProxyConfiguration(internalcfg *ClusterConfiguration, obj *kubep
 | 
				
			|||||||
		obj.ClusterCIDR = internalcfg.Networking.PodSubnet
 | 
							obj.ClusterCIDR = internalcfg.Networking.PodSubnet
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if obj.ClientConnection.KubeConfigFile == "" {
 | 
						if obj.ClientConnection.Kubeconfig == "" {
 | 
				
			||||||
		obj.ClientConnection.KubeConfigFile = "/var/lib/kube-proxy/kubeconfig.conf"
 | 
							obj.ClientConnection.Kubeconfig = "/var/lib/kube-proxy/kubeconfig.conf"
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,8 +45,8 @@ func DefaultKubeProxyConfiguration(internalcfg *kubeadmapi.ClusterConfiguration)
 | 
				
			|||||||
		externalproxycfg.ClusterCIDR = internalcfg.Networking.PodSubnet
 | 
							externalproxycfg.ClusterCIDR = internalcfg.Networking.PodSubnet
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if externalproxycfg.ClientConnection.KubeConfigFile == "" {
 | 
						if externalproxycfg.ClientConnection.Kubeconfig == "" {
 | 
				
			||||||
		externalproxycfg.ClientConnection.KubeConfigFile = KubeproxyKubeConfigFileName
 | 
							externalproxycfg.ClientConnection.Kubeconfig = KubeproxyKubeConfigFileName
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Run the rest of the kube-proxy defaulting code
 | 
						// Run the rest of the kube-proxy defaulting code
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -29,7 +29,7 @@ ComponentConfigs:
 | 
				
			|||||||
      AcceptContentTypes: ""
 | 
					      AcceptContentTypes: ""
 | 
				
			||||||
      Burst: 10
 | 
					      Burst: 10
 | 
				
			||||||
      ContentType: application/vnd.kubernetes.protobuf
 | 
					      ContentType: application/vnd.kubernetes.protobuf
 | 
				
			||||||
      KubeConfigFile: /var/lib/kube-proxy/kubeconfig.conf
 | 
					      Kubeconfig: /var/lib/kube-proxy/kubeconfig.conf
 | 
				
			||||||
      QPS: 5
 | 
					      QPS: 5
 | 
				
			||||||
    ClusterCIDR: ""
 | 
					    ClusterCIDR: ""
 | 
				
			||||||
    ConfigSyncPeriod: 15m0s
 | 
					    ConfigSyncPeriod: 15m0s
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,25 +21,10 @@ import (
 | 
				
			|||||||
	"sort"
 | 
						"sort"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						apimachineryconfig "k8s.io/apimachinery/pkg/apis/config"
 | 
				
			||||||
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 | 
						metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ClientConnectionConfiguration contains details for constructing a client.
 | 
					 | 
				
			||||||
type ClientConnectionConfiguration struct {
 | 
					 | 
				
			||||||
	// kubeconfig is the path to a kubeconfig file.
 | 
					 | 
				
			||||||
	KubeConfigFile string
 | 
					 | 
				
			||||||
	// acceptContentTypes defines the Accept header sent by clients when connecting to a server, overriding the
 | 
					 | 
				
			||||||
	// default value of 'application/json'. This field will control all connections to the server used by a particular
 | 
					 | 
				
			||||||
	// client.
 | 
					 | 
				
			||||||
	AcceptContentTypes string
 | 
					 | 
				
			||||||
	// contentType is the content type used when sending data to the server from this client.
 | 
					 | 
				
			||||||
	ContentType string
 | 
					 | 
				
			||||||
	// qps controls the number of queries per second allowed for this connection.
 | 
					 | 
				
			||||||
	QPS float32
 | 
					 | 
				
			||||||
	// burst allows extra queries to accumulate when a client is exceeding its rate.
 | 
					 | 
				
			||||||
	Burst int32
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// KubeProxyIPTablesConfiguration contains iptables-related configuration
 | 
					// KubeProxyIPTablesConfiguration contains iptables-related configuration
 | 
				
			||||||
// details for the Kubernetes proxy server.
 | 
					// details for the Kubernetes proxy server.
 | 
				
			||||||
type KubeProxyIPTablesConfiguration struct {
 | 
					type KubeProxyIPTablesConfiguration struct {
 | 
				
			||||||
@@ -123,7 +108,7 @@ type KubeProxyConfiguration struct {
 | 
				
			|||||||
	HostnameOverride string
 | 
						HostnameOverride string
 | 
				
			||||||
	// clientConnection specifies the kubeconfig file and client connection settings for the proxy
 | 
						// clientConnection specifies the kubeconfig file and client connection settings for the proxy
 | 
				
			||||||
	// server to use when communicating with the apiserver.
 | 
						// server to use when communicating with the apiserver.
 | 
				
			||||||
	ClientConnection ClientConnectionConfiguration
 | 
						ClientConnection apimachineryconfig.ClientConnectionConfiguration
 | 
				
			||||||
	// iptables contains iptables-related configuration options.
 | 
						// iptables contains iptables-related configuration options.
 | 
				
			||||||
	IPTables KubeProxyIPTablesConfiguration
 | 
						IPTables KubeProxyIPTablesConfiguration
 | 
				
			||||||
	// ipvs contains ipvs-related configuration options.
 | 
						// ipvs contains ipvs-related configuration options.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,25 +17,10 @@ limitations under the License.
 | 
				
			|||||||
package v1alpha1
 | 
					package v1alpha1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import (
 | 
					import (
 | 
				
			||||||
 | 
						apimachineryconfigv1alpha1 "k8s.io/apimachinery/pkg/apis/config/v1alpha1"
 | 
				
			||||||
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 | 
						metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// ClientConnectionConfiguration contains details for constructing a client.
 | 
					 | 
				
			||||||
type ClientConnectionConfiguration struct {
 | 
					 | 
				
			||||||
	// kubeconfig is the path to a kubeconfig file.
 | 
					 | 
				
			||||||
	KubeConfigFile string `json:"kubeconfig"`
 | 
					 | 
				
			||||||
	// acceptContentTypes defines the Accept header sent by clients when connecting to a server, overriding the
 | 
					 | 
				
			||||||
	// default value of 'application/json'. This field will control all connections to the server used by a particular
 | 
					 | 
				
			||||||
	// client.
 | 
					 | 
				
			||||||
	AcceptContentTypes string `json:"acceptContentTypes"`
 | 
					 | 
				
			||||||
	// contentType is the content type used when sending data to the server from this client.
 | 
					 | 
				
			||||||
	ContentType string `json:"contentType"`
 | 
					 | 
				
			||||||
	// qps controls the number of queries per second allowed for this connection.
 | 
					 | 
				
			||||||
	QPS float32 `json:"qps"`
 | 
					 | 
				
			||||||
	// burst allows extra queries to accumulate when a client is exceeding its rate.
 | 
					 | 
				
			||||||
	Burst int `json:"burst"`
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// KubeProxyIPTablesConfiguration contains iptables-related configuration
 | 
					// KubeProxyIPTablesConfiguration contains iptables-related configuration
 | 
				
			||||||
// details for the Kubernetes proxy server.
 | 
					// details for the Kubernetes proxy server.
 | 
				
			||||||
type KubeProxyIPTablesConfiguration struct {
 | 
					type KubeProxyIPTablesConfiguration struct {
 | 
				
			||||||
@@ -119,7 +104,7 @@ type KubeProxyConfiguration struct {
 | 
				
			|||||||
	HostnameOverride string `json:"hostnameOverride"`
 | 
						HostnameOverride string `json:"hostnameOverride"`
 | 
				
			||||||
	// clientConnection specifies the kubeconfig file and client connection settings for the proxy
 | 
						// clientConnection specifies the kubeconfig file and client connection settings for the proxy
 | 
				
			||||||
	// server to use when communicating with the apiserver.
 | 
						// server to use when communicating with the apiserver.
 | 
				
			||||||
	ClientConnection ClientConnectionConfiguration `json:"clientConnection"`
 | 
						ClientConnection apimachineryconfigv1alpha1.ClientConnectionConfiguration `json:"clientConnection"`
 | 
				
			||||||
	// iptables contains iptables-related configuration options.
 | 
						// iptables contains iptables-related configuration options.
 | 
				
			||||||
	IPTables KubeProxyIPTablesConfiguration `json:"iptables"`
 | 
						IPTables KubeProxyIPTablesConfiguration `json:"iptables"`
 | 
				
			||||||
	// ipvs contains ipvs-related configuration options.
 | 
						// ipvs contains ipvs-related configuration options.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,6 +23,7 @@ import (
 | 
				
			|||||||
	"strconv"
 | 
						"strconv"
 | 
				
			||||||
	"strings"
 | 
						"strings"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						apimachineryconfig "k8s.io/apimachinery/pkg/apis/config"
 | 
				
			||||||
	utilnet "k8s.io/apimachinery/pkg/util/net"
 | 
						utilnet "k8s.io/apimachinery/pkg/util/net"
 | 
				
			||||||
	"k8s.io/apimachinery/pkg/util/sets"
 | 
						"k8s.io/apimachinery/pkg/util/sets"
 | 
				
			||||||
	"k8s.io/apimachinery/pkg/util/validation/field"
 | 
						"k8s.io/apimachinery/pkg/util/validation/field"
 | 
				
			||||||
@@ -186,7 +187,7 @@ func validateProxyModeWindows(mode kubeproxyconfig.ProxyMode, fldPath *field.Pat
 | 
				
			|||||||
	return field.ErrorList{field.Invalid(fldPath.Child("ProxyMode"), string(mode), errMsg)}
 | 
						return field.ErrorList{field.Invalid(fldPath.Child("ProxyMode"), string(mode), errMsg)}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func validateClientConnectionConfiguration(config kubeproxyconfig.ClientConnectionConfiguration, fldPath *field.Path) field.ErrorList {
 | 
					func validateClientConnectionConfiguration(config apimachineryconfig.ClientConnectionConfiguration, fldPath *field.Path) field.ErrorList {
 | 
				
			||||||
	allErrs := field.ErrorList{}
 | 
						allErrs := field.ErrorList{}
 | 
				
			||||||
	allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(config.Burst), fldPath.Child("Burst"))...)
 | 
						allErrs = append(allErrs, apivalidation.ValidateNonnegativeField(int64(config.Burst), fldPath.Child("Burst"))...)
 | 
				
			||||||
	return allErrs
 | 
						return allErrs
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,6 +23,7 @@ import (
 | 
				
			|||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
	"time"
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						apimachineryconfig "k8s.io/apimachinery/pkg/apis/config"
 | 
				
			||||||
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 | 
						metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 | 
				
			||||||
	"k8s.io/apimachinery/pkg/util/validation/field"
 | 
						"k8s.io/apimachinery/pkg/util/validation/field"
 | 
				
			||||||
	kubeproxyconfig "k8s.io/kubernetes/pkg/proxy/apis/config"
 | 
						kubeproxyconfig "k8s.io/kubernetes/pkg/proxy/apis/config"
 | 
				
			||||||
@@ -574,7 +575,7 @@ func TestValidateProxyMode(t *testing.T) {
 | 
				
			|||||||
func TestValidateClientConnectionConfiguration(t *testing.T) {
 | 
					func TestValidateClientConnectionConfiguration(t *testing.T) {
 | 
				
			||||||
	newPath := field.NewPath("KubeProxyConfiguration")
 | 
						newPath := field.NewPath("KubeProxyConfiguration")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	successCases := []kubeproxyconfig.ClientConnectionConfiguration{
 | 
						successCases := []apimachineryconfig.ClientConnectionConfiguration{
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			Burst: 0,
 | 
								Burst: 0,
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
@@ -590,11 +591,11 @@ func TestValidateClientConnectionConfiguration(t *testing.T) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	errorCases := []struct {
 | 
						errorCases := []struct {
 | 
				
			||||||
		ccc kubeproxyconfig.ClientConnectionConfiguration
 | 
							ccc apimachineryconfig.ClientConnectionConfiguration
 | 
				
			||||||
		msg string
 | 
							msg string
 | 
				
			||||||
	}{
 | 
						}{
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			ccc: kubeproxyconfig.ClientConnectionConfiguration{Burst: -5},
 | 
								ccc: apimachineryconfig.ClientConnectionConfiguration{Burst: -5},
 | 
				
			||||||
			msg: "must be greater than or equal to 0",
 | 
								msg: "must be greater than or equal to 0",
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user