diff --git a/cmd/kubelet/app/options/options.go b/cmd/kubelet/app/options/options.go index d417fe1641c..e4c767525ea 100644 --- a/cmd/kubelet/app/options/options.go +++ b/cmd/kubelet/app/options/options.go @@ -111,15 +111,15 @@ func NewKubeletServer() *KubeletServer { RegisterSchedulable: true, RegistryBurst: 10, RegistryPullQPS: 5.0, - ResourceContainer: "", + KubeletCgroups: "", RktPath: "", RktStage1Image: "", RootDirectory: defaultRootDir, - RuntimeContainer: "", + RuntimeCgroups: "", SerializeImagePulls: true, StreamingConnectionIdleTimeout: unversioned.Duration{4 * time.Hour}, SyncFrequency: unversioned.Duration{1 * time.Minute}, - SystemContainer: "", + SystemCgroups: "", ReconcileCIDR: true, KubeAPIQPS: 5.0, KubeAPIBurst: 10, @@ -191,13 +191,20 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&s.VolumePluginDir, "volume-plugin-dir", s.VolumePluginDir, " The full path of the directory in which to search for additional third party volume plugins") fs.StringVar(&s.CloudProvider, "cloud-provider", s.CloudProvider, "The provider for cloud services. Empty string for no provider.") fs.StringVar(&s.CloudConfigFile, "cloud-config", s.CloudConfigFile, "The path to the cloud provider configuration file. Empty string for no configuration file.") - fs.StringVar(&s.ResourceContainer, "resource-container", s.ResourceContainer, "Optional absolute name of the resource-only container to create and run the Kubelet in.") + + fs.StringVar(&s.KubeletCgroups, "resource-container", s.KubeletCgroups, "Optional absolute name of the resource-only container to create and run the Kubelet in.") + fs.MarkDeprecated("resource-container", "Use --kubelet-cgroups instead. Will be removed in a future version.") + fs.StringVar(&s.KubeletCgroups, "kubelet-cgroups", s.KubeletCgroups, "Optional absolute name of cgroups to create and run the Kubelet in.") + + fs.StringVar(&s.SystemCgroups, "system-container", s.SystemCgroups, "Optional resource-only container in which to place all non-kernel processes that are not already in a container. Empty for no container. Rolling back the flag requires a reboot. (Default: \"\").") + fs.MarkDeprecated("system-container", "Use --system-cgroups instead. Will be removed in a future version.") + fs.StringVar(&s.SystemCgroups, "system-cgroups", s.SystemCgroups, "Optional absolute name of cgroups in which to place all non-kernel processes that are not already inside a cgroup under `/`. Empty for no container. Rolling back the flag requires a reboot. (Default: \"\").") + fs.StringVar(&s.CgroupRoot, "cgroup-root", s.CgroupRoot, "Optional root cgroup to use for pods. This is handled by the container runtime on a best effort basis. Default: '', which means use the container runtime default.") fs.StringVar(&s.ContainerRuntime, "container-runtime", s.ContainerRuntime, "The container runtime to use. Possible values: 'docker', 'rkt'. Default: 'docker'.") fs.StringVar(&s.LockFilePath, "lock-file", s.LockFilePath, " The path to file for kubelet to use as a lock file.") fs.StringVar(&s.RktPath, "rkt-path", s.RktPath, "Path of rkt binary. Leave empty to use the first rkt in $PATH. Only used if --container-runtime='rkt'") fs.StringVar(&s.RktStage1Image, "rkt-stage1-image", s.RktStage1Image, "image to use as stage1. Local paths and http/https URLs are supported. If empty, the 'stage1.aci' in the same directory as '--rkt-path' will be used") - fs.StringVar(&s.SystemContainer, "system-container", s.SystemContainer, "Optional resource-only container in which to place all non-kernel processes that are not already in a container. Empty for no container. Rolling back the flag requires a reboot. (Default: \"\").") fs.BoolVar(&s.ConfigureCBR0, "configure-cbr0", s.ConfigureCBR0, "If true, kubelet will configure cbr0 based on Node.Spec.PodCIDR.") fs.BoolVar(&s.HairpinMode, "configure-hairpin-mode", s.HairpinMode, "If true, kubelet will set the hairpin mode flag on container interfaces. This allows endpoints of a Service to loadbalance back to themselves if they should try to access their own Service.") fs.IntVar(&s.MaxPods, "max-pods", s.MaxPods, "Number of Pods that can run on this Kubelet.") @@ -222,5 +229,5 @@ func (s *KubeletServer) AddFlags(fs *pflag.FlagSet) { fs.DurationVar(&s.OutOfDiskTransitionFrequency.Duration, "outofdisk-transition-frequency", s.OutOfDiskTransitionFrequency.Duration, "Duration for which the kubelet has to wait before transitioning out of out-of-disk node condition status. Default: 5m0s") fs.StringVar(&s.NodeIP, "node-ip", s.NodeIP, "IP address of the node. If set, kubelet will use this IP address for the node") fs.BoolVar(&s.EnableCustomMetrics, "enable-custom-metrics", s.EnableCustomMetrics, "Support for gathering custom metrics.") - fs.StringVar(&s.RuntimeContainer, "runtime-container", s.RuntimeContainer, "Optional absolute name of cgroups to create and run the runtime in.") + fs.StringVar(&s.RuntimeCgroups, "runtime-cgroups", s.RuntimeCgroups, "Optional absolute name of cgroups to create and run the runtime in.") } diff --git a/cmd/kubelet/app/server.go b/cmd/kubelet/app/server.go index db75bb35adf..04c287a155d 100644 --- a/cmd/kubelet/app/server.go +++ b/cmd/kubelet/app/server.go @@ -194,7 +194,7 @@ func UnsecuredKubeletConfig(s *options.KubeletServer) (*KubeletConfig, error) { CPUCFSQuota: s.CPUCFSQuota, DiskSpacePolicy: diskSpacePolicy, DockerClient: dockertools.ConnectToDockerOrDie(s.DockerEndpoint), - RuntimeContainer: s.RuntimeContainer, + RuntimeCgroups: s.RuntimeCgroups, DockerExecHandler: dockerExecHandler, EnableCustomMetrics: s.EnableCustomMetrics, EnableDebuggingHandlers: s.EnableDebuggingHandlers, @@ -236,7 +236,7 @@ func UnsecuredKubeletConfig(s *options.KubeletServer) (*KubeletConfig, error) { RegistryPullQPS: s.RegistryPullQPS, ResolverConfig: s.ResolverConfig, Reservation: *reservation, - ResourceContainer: s.ResourceContainer, + KubeletCgroups: s.KubeletCgroups, RktPath: s.RktPath, RktStage1Image: s.RktStage1Image, RootDirectory: s.RootDirectory, @@ -245,7 +245,7 @@ func UnsecuredKubeletConfig(s *options.KubeletServer) (*KubeletConfig, error) { StandaloneMode: (len(s.APIServerList) == 0), StreamingConnectionIdleTimeout: s.StreamingConnectionIdleTimeout.Duration, SyncFrequency: s.SyncFrequency.Duration, - SystemContainer: s.SystemContainer, + SystemCgroups: s.SystemCgroups, TLSOptions: tlsOptions, Writer: writer, VolumePlugins: ProbeVolumePlugins(s.VolumePluginDir), @@ -306,15 +306,15 @@ func Run(s *options.KubeletServer, kcfg *KubeletConfig) error { } if kcfg.ContainerManager == nil { - if kcfg.SystemContainer != "" && kcfg.CgroupRoot == "" { + if kcfg.SystemCgroups != "" && kcfg.CgroupRoot == "" { return fmt.Errorf("invalid configuration: system container was specified and cgroup root was not specified") } kcfg.ContainerManager, err = cm.NewContainerManager(kcfg.Mounter, kcfg.CAdvisorInterface, cm.NodeConfig{ - RuntimeContainerName: kcfg.RuntimeContainer, - SystemContainerName: kcfg.SystemContainer, - KubeletContainerName: kcfg.ResourceContainer, - ContainerRuntime: kcfg.ContainerRuntime, + RuntimeCgroupsName: kcfg.RuntimeCgroups, + SystemCgroupsName: kcfg.SystemCgroups, + KubeletCgroupsName: kcfg.KubeletCgroups, + ContainerRuntime: kcfg.ContainerRuntime, }) if err != nil { return err @@ -510,7 +510,7 @@ func SimpleKubelet(client *clientset.Clientset, CPUCFSQuota: true, DiskSpacePolicy: diskSpacePolicy, DockerClient: dockerClient, - RuntimeContainer: "", + RuntimeCgroups: "", DockerExecHandler: &dockertools.NativeExecHandler{}, EnableCustomMetrics: false, EnableDebuggingHandlers: true, @@ -539,11 +539,11 @@ func SimpleKubelet(client *clientset.Clientset, RegistryBurst: 10, RegistryPullQPS: 5.0, ResolverConfig: kubetypes.ResolvConfDefault, - ResourceContainer: "/kubelet", + KubeletCgroups: "/kubelet", RootDirectory: rootDir, SerializeImagePulls: true, SyncFrequency: syncFrequency, - SystemContainer: "", + SystemCgroups: "", TLSOptions: tlsOptions, VolumePlugins: volumePlugins, Writer: &io.StdWriter{}, @@ -686,7 +686,7 @@ type KubeletConfig struct { CPUCFSQuota bool DiskSpacePolicy kubelet.DiskSpacePolicy DockerClient dockertools.DockerInterface - RuntimeContainer string + RuntimeCgroups string DockerExecHandler dockertools.ExecHandler EnableCustomMetrics bool EnableDebuggingHandlers bool @@ -733,7 +733,7 @@ type KubeletConfig struct { RegistryPullQPS float64 Reservation kubetypes.Reservation ResolverConfig string - ResourceContainer string + KubeletCgroups string RktPath string RktStage1Image string RootDirectory string @@ -742,7 +742,7 @@ type KubeletConfig struct { StandaloneMode bool StreamingConnectionIdleTimeout time.Duration SyncFrequency time.Duration - SystemContainer string + SystemCgroups string TLSOptions *server.TLSOptions Writer io.Writer VolumePlugins []volume.VolumePlugin diff --git a/contrib/mesos/pkg/executor/service/service.go b/contrib/mesos/pkg/executor/service/service.go index f4f79ced770..a613a9cb365 100644 --- a/contrib/mesos/pkg/executor/service/service.go +++ b/contrib/mesos/pkg/executor/service/service.go @@ -180,7 +180,7 @@ func (s *KubeletExecutorServer) runKubelet( return decorated, pc, nil } - kcfg.RuntimeContainer = "" // don't move the docker daemon into a cgroup + kcfg.RuntimeCgroups = "" // don't move the docker daemon into a cgroup kcfg.Hostname = kcfg.HostnameOverride kcfg.KubeClient = apiclient @@ -201,7 +201,7 @@ func (s *KubeletExecutorServer) runKubelet( kcfg.NodeName = kcfg.HostnameOverride kcfg.PodConfig = kconfig.NewPodConfig(kconfig.PodConfigNotificationIncremental, kcfg.Recorder) // override the default pod source kcfg.StandaloneMode = false - kcfg.SystemContainer = "" // don't take control over other system processes. + kcfg.SystemCgroups = "" // don't take control over other system processes. if kcfg.Cloud != nil { // fail early and hard because having the cloud provider loaded would go unnoticed, // but break bigger cluster because accessing the state.json from every slave kills the master. @@ -217,10 +217,10 @@ func (s *KubeletExecutorServer) runKubelet( kcfg.CAdvisorInterface = cAdvisorInterface kcfg.ContainerManager, err = cm.NewContainerManager(kcfg.Mounter, cAdvisorInterface, cm.NodeConfig{ - RuntimeContainerName: kcfg.RuntimeContainer, - SystemContainerName: kcfg.SystemContainer, - KubeletContainerName: kcfg.ResourceContainer, - ContainerRuntime: kcfg.ContainerRuntime, + RuntimeCgroupsName: kcfg.RuntimeCgroups, + SystemCgroupsName: kcfg.SystemCgroups, + KubeletCgroupsName: kcfg.KubeletCgroups, + ContainerRuntime: kcfg.ContainerRuntime, }) if err != nil { return err diff --git a/hack/verify-flags/known-flags.txt b/hack/verify-flags/known-flags.txt index 54a093531e6..0d63b18d04b 100644 --- a/hack/verify-flags/known-flags.txt +++ b/hack/verify-flags/known-flags.txt @@ -171,6 +171,7 @@ kubectl-path kubelet-address kubelet-cadvisor-port kubelet-certificate-authority +kubelet-cgroups kubelet-client-certificate kubelet-client-key kubelet-docker-endpoint @@ -311,7 +312,7 @@ root-ca-file root-dir run-proxy runtime-config -runtime-container +runtime-cgroups save-config scheduler-config scheduler-name @@ -348,6 +349,7 @@ storage-versions streaming-connection-idle-timeout suicide-timeout sync-frequency +system-cgroups system-container system-reserved target-port diff --git a/pkg/apis/componentconfig/types.go b/pkg/apis/componentconfig/types.go index 52fc1226ceb..376ab823be7 100644 --- a/pkg/apis/componentconfig/types.go +++ b/pkg/apis/componentconfig/types.go @@ -52,9 +52,9 @@ type KubeProxyConfiguration struct { // portRange is the range of host ports (beginPort-endPort, inclusive) that may be consumed // in order to proxy service traffic. If unspecified (0-0) then ports will be randomly chosen. PortRange string `json:"portRange"` - // resourceContainer is the bsolute name of the resource-only container to create and run + // resourceContainer is the absolute name of the resource-only container to create and run // the Kube-proxy in (Default: /kube-proxy). - ResourceContainer string `json:"resourceContainer"` + ResourceContainer string `json:"kubeletCgroups"` // udpIdleTimeout is how long an idle UDP connection will be kept open (e.g. '250ms', '2s'). // Must be greater than 0. Only applicable for proxyMode=userspace. UDPIdleTimeout unversioned.Duration `json:"udpTimeoutMilliseconds"` @@ -223,9 +223,14 @@ type KubeletConfiguration struct { CloudProvider string `json:"cloudProvider,omitempty"` // cloudConfigFile is the path to the cloud provider configuration file. CloudConfigFile string `json:"cloudConfigFile,omitempty"` - // resourceContainer is the absolute name of the resource-only container - // to create and run the Kubelet in. - ResourceContainer string `json:"resourceContainer,omitempty"` + // KubeletCgroups is the absolute name of cgroups to isolate the kubelet in. + KubeletCgroups string `json:"kubeletCgroups,omitempty"` + // Cgroups that container runtime is expected to be isolated in. + RuntimeCgroups string `json:"runtimeCgroups,omitempty"` + // SystemCgroups is absolute name of cgroups in which to place + // all non-kernel processes that are not already in a container. Empty + // for no container. Rolling back the flag requires a reboot. + SystemCgroups string `json:"systemContainer,omitempty"` // cgroupRoot is the root cgroup to use for pods. This is handled by the // container runtime on a best effort basis. CgroupRoot string `json:"cgroupRoot,omitempty"` @@ -241,10 +246,6 @@ type KubeletConfiguration struct { // rktStage1Image is the image to use as stage1. Local paths and // http/https URLs are supported. RktStage1Image string `json:"rktStage1Image,omitempty"` - // systemContainer is the resource-only container in which to place - // all non-kernel processes that are not already in a container. Empty - // for no container. Rolling back the flag requires a reboot. - SystemContainer string `json:"systemContainer"` // configureCBR0 enables the kublet to configure cbr0 based on // Node.Spec.PodCIDR. ConfigureCBR0 bool `json:"configureCbr0"` @@ -304,8 +305,6 @@ type KubeletConfiguration struct { NonMasqueradeCIDR string `json:"nonMasqueradeCIDR"` // enable gathering custom metrics. EnableCustomMetrics bool `json:"enableCustomMetrics"` - // The cgroup that container runtime is expected to be isolated in. - RuntimeContainer string `json:"runtimeContainer,omitempty"` } type KubeSchedulerConfiguration struct { diff --git a/pkg/apis/componentconfig/v1alpha1/types.generated.go b/pkg/apis/componentconfig/v1alpha1/types.generated.go deleted file mode 100644 index a25f860c2e0..00000000000 --- a/pkg/apis/componentconfig/v1alpha1/types.generated.go +++ /dev/null @@ -1,2098 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors All rights reserved. - -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. -*/ - -// ************************************************************ -// DO NOT EDIT. -// THIS FILE IS AUTO-GENERATED BY codecgen. -// ************************************************************ - -package v1alpha1 - -import ( - "errors" - "fmt" - codec1978 "github.com/ugorji/go/codec" - pkg1_unversioned "k8s.io/kubernetes/pkg/api/unversioned" - "reflect" - "runtime" - time "time" -) - -const ( - // ----- content types ---- - codecSelferC_UTF81234 = 1 - codecSelferC_RAW1234 = 0 - // ----- value types used ---- - codecSelferValueTypeArray1234 = 10 - codecSelferValueTypeMap1234 = 9 - // ----- containerStateValues ---- - codecSelfer_containerMapKey1234 = 2 - codecSelfer_containerMapValue1234 = 3 - codecSelfer_containerMapEnd1234 = 4 - codecSelfer_containerArrayElem1234 = 6 - codecSelfer_containerArrayEnd1234 = 7 -) - -var ( - codecSelferBitsize1234 = uint8(reflect.TypeOf(uint(0)).Bits()) - codecSelferOnlyMapOrArrayEncodeToStructErr1234 = errors.New(`only encoded map or array can be decoded into a struct`) -) - -type codecSelfer1234 struct{} - -func init() { - if codec1978.GenVersion != 5 { - _, file, _, _ := runtime.Caller(0) - err := fmt.Errorf("codecgen version mismatch: current: %v, need %v. Re-generate file: %v", - 5, codec1978.GenVersion, file) - panic(err) - } - if false { // reference the types, but skip this branch at build/run time - var v0 pkg1_unversioned.TypeMeta - var v1 time.Duration - _, _ = v0, v1 - } -} - -func (x *KubeProxyConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym1 := z.EncBinary() - _ = yym1 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep2 := !z.EncBinary() - yy2arr2 := z.EncBasicHandle().StructToArray - var yyq2 [18]bool - _, _, _ = yysep2, yyq2, yy2arr2 - const yyr2 bool = false - yyq2[16] = x.Kind != "" - yyq2[17] = x.APIVersion != "" - var yynn2 int - if yyr2 || yy2arr2 { - r.EncodeArrayStart(18) - } else { - yynn2 = 16 - for _, b := range yyq2 { - if b { - yynn2++ - } - } - r.EncodeMapStart(yynn2) - yynn2 = 0 - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym4 := z.EncBinary() - _ = yym4 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.BindAddress)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("bindAddress")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym5 := z.EncBinary() - _ = yym5 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.BindAddress)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym7 := z.EncBinary() - _ = yym7 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.HealthzBindAddress)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("healthzBindAddress")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym8 := z.EncBinary() - _ = yym8 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.HealthzBindAddress)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym10 := z.EncBinary() - _ = yym10 - if false { - } else { - r.EncodeInt(int64(x.HealthzPort)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("healthzPort")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym11 := z.EncBinary() - _ = yym11 - if false { - } else { - r.EncodeInt(int64(x.HealthzPort)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym13 := z.EncBinary() - _ = yym13 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.HostnameOverride)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("hostnameOverride")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym14 := z.EncBinary() - _ = yym14 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.HostnameOverride)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.IPTablesMasqueradeBit == nil { - r.EncodeNil() - } else { - yy16 := *x.IPTablesMasqueradeBit - yym17 := z.EncBinary() - _ = yym17 - if false { - } else { - r.EncodeInt(int64(yy16)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("iptablesMasqueradeBit")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.IPTablesMasqueradeBit == nil { - r.EncodeNil() - } else { - yy18 := *x.IPTablesMasqueradeBit - yym19 := z.EncBinary() - _ = yym19 - if false { - } else { - r.EncodeInt(int64(yy18)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy21 := &x.IPTablesSyncPeriod - yym22 := z.EncBinary() - _ = yym22 - if false { - } else if z.HasExtensions() && z.EncExt(yy21) { - } else if !yym22 && z.IsJSONHandle() { - z.EncJSONMarshal(yy21) - } else { - z.EncFallback(yy21) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("iptablesSyncPeriodSeconds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy23 := &x.IPTablesSyncPeriod - yym24 := z.EncBinary() - _ = yym24 - if false { - } else if z.HasExtensions() && z.EncExt(yy23) { - } else if !yym24 && z.IsJSONHandle() { - z.EncJSONMarshal(yy23) - } else { - z.EncFallback(yy23) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym26 := z.EncBinary() - _ = yym26 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.KubeconfigPath)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kubeconfigPath")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym27 := z.EncBinary() - _ = yym27 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.KubeconfigPath)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym29 := z.EncBinary() - _ = yym29 - if false { - } else { - r.EncodeBool(bool(x.MasqueradeAll)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("masqueradeAll")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym30 := z.EncBinary() - _ = yym30 - if false { - } else { - r.EncodeBool(bool(x.MasqueradeAll)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym32 := z.EncBinary() - _ = yym32 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Master)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("master")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym33 := z.EncBinary() - _ = yym33 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Master)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.OOMScoreAdj == nil { - r.EncodeNil() - } else { - yy35 := *x.OOMScoreAdj - yym36 := z.EncBinary() - _ = yym36 - if false { - } else { - r.EncodeInt(int64(yy35)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("oomScoreAdj")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.OOMScoreAdj == nil { - r.EncodeNil() - } else { - yy37 := *x.OOMScoreAdj - yym38 := z.EncBinary() - _ = yym38 - if false { - } else { - r.EncodeInt(int64(yy37)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - x.Mode.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("mode")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - x.Mode.CodecEncodeSelf(e) - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym41 := z.EncBinary() - _ = yym41 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.PortRange)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("portRange")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym42 := z.EncBinary() - _ = yym42 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.PortRange)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym44 := z.EncBinary() - _ = yym44 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ResourceContainer)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("resourceContainer")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym45 := z.EncBinary() - _ = yym45 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.ResourceContainer)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy47 := &x.UDPIdleTimeout - yym48 := z.EncBinary() - _ = yym48 - if false { - } else if z.HasExtensions() && z.EncExt(yy47) { - } else if !yym48 && z.IsJSONHandle() { - z.EncJSONMarshal(yy47) - } else { - z.EncFallback(yy47) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("udpTimeoutMilliseconds")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy49 := &x.UDPIdleTimeout - yym50 := z.EncBinary() - _ = yym50 - if false { - } else if z.HasExtensions() && z.EncExt(yy49) { - } else if !yym50 && z.IsJSONHandle() { - z.EncJSONMarshal(yy49) - } else { - z.EncFallback(yy49) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym52 := z.EncBinary() - _ = yym52 - if false { - } else { - r.EncodeInt(int64(x.ConntrackMax)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("conntrackMax")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym53 := z.EncBinary() - _ = yym53 - if false { - } else { - r.EncodeInt(int64(x.ConntrackMax)) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy55 := &x.ConntrackTCPEstablishedTimeout - yym56 := z.EncBinary() - _ = yym56 - if false { - } else if z.HasExtensions() && z.EncExt(yy55) { - } else if !yym56 && z.IsJSONHandle() { - z.EncJSONMarshal(yy55) - } else { - z.EncFallback(yy55) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("conntrackTCPEstablishedTimeout")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy57 := &x.ConntrackTCPEstablishedTimeout - yym58 := z.EncBinary() - _ = yym58 - if false { - } else if z.HasExtensions() && z.EncExt(yy57) { - } else if !yym58 && z.IsJSONHandle() { - z.EncJSONMarshal(yy57) - } else { - z.EncFallback(yy57) - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[16] { - yym60 := z.EncBinary() - _ = yym60 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[16] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym61 := z.EncBinary() - _ = yym61 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq2[17] { - yym63 := z.EncBinary() - _ = yym63 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq2[17] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym64 := z.EncBinary() - _ = yym64 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr2 || yy2arr2 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *KubeProxyConfiguration) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym65 := z.DecBinary() - _ = yym65 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct66 := r.ContainerType() - if yyct66 == codecSelferValueTypeMap1234 { - yyl66 := r.ReadMapStart() - if yyl66 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl66, d) - } - } else if yyct66 == codecSelferValueTypeArray1234 { - yyl66 := r.ReadArrayStart() - if yyl66 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl66, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *KubeProxyConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys67Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys67Slc - var yyhl67 bool = l >= 0 - for yyj67 := 0; ; yyj67++ { - if yyhl67 { - if yyj67 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys67Slc = r.DecodeBytes(yys67Slc, true, true) - yys67 := string(yys67Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys67 { - case "bindAddress": - if r.TryDecodeAsNil() { - x.BindAddress = "" - } else { - x.BindAddress = string(r.DecodeString()) - } - case "healthzBindAddress": - if r.TryDecodeAsNil() { - x.HealthzBindAddress = "" - } else { - x.HealthzBindAddress = string(r.DecodeString()) - } - case "healthzPort": - if r.TryDecodeAsNil() { - x.HealthzPort = 0 - } else { - x.HealthzPort = int32(r.DecodeInt(32)) - } - case "hostnameOverride": - if r.TryDecodeAsNil() { - x.HostnameOverride = "" - } else { - x.HostnameOverride = string(r.DecodeString()) - } - case "iptablesMasqueradeBit": - if r.TryDecodeAsNil() { - if x.IPTablesMasqueradeBit != nil { - x.IPTablesMasqueradeBit = nil - } - } else { - if x.IPTablesMasqueradeBit == nil { - x.IPTablesMasqueradeBit = new(int32) - } - yym73 := z.DecBinary() - _ = yym73 - if false { - } else { - *((*int32)(x.IPTablesMasqueradeBit)) = int32(r.DecodeInt(32)) - } - } - case "iptablesSyncPeriodSeconds": - if r.TryDecodeAsNil() { - x.IPTablesSyncPeriod = pkg1_unversioned.Duration{} - } else { - yyv74 := &x.IPTablesSyncPeriod - yym75 := z.DecBinary() - _ = yym75 - if false { - } else if z.HasExtensions() && z.DecExt(yyv74) { - } else if !yym75 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv74) - } else { - z.DecFallback(yyv74, false) - } - } - case "kubeconfigPath": - if r.TryDecodeAsNil() { - x.KubeconfigPath = "" - } else { - x.KubeconfigPath = string(r.DecodeString()) - } - case "masqueradeAll": - if r.TryDecodeAsNil() { - x.MasqueradeAll = false - } else { - x.MasqueradeAll = bool(r.DecodeBool()) - } - case "master": - if r.TryDecodeAsNil() { - x.Master = "" - } else { - x.Master = string(r.DecodeString()) - } - case "oomScoreAdj": - if r.TryDecodeAsNil() { - if x.OOMScoreAdj != nil { - x.OOMScoreAdj = nil - } - } else { - if x.OOMScoreAdj == nil { - x.OOMScoreAdj = new(int32) - } - yym80 := z.DecBinary() - _ = yym80 - if false { - } else { - *((*int32)(x.OOMScoreAdj)) = int32(r.DecodeInt(32)) - } - } - case "mode": - if r.TryDecodeAsNil() { - x.Mode = "" - } else { - x.Mode = ProxyMode(r.DecodeString()) - } - case "portRange": - if r.TryDecodeAsNil() { - x.PortRange = "" - } else { - x.PortRange = string(r.DecodeString()) - } - case "resourceContainer": - if r.TryDecodeAsNil() { - x.ResourceContainer = "" - } else { - x.ResourceContainer = string(r.DecodeString()) - } - case "udpTimeoutMilliseconds": - if r.TryDecodeAsNil() { - x.UDPIdleTimeout = pkg1_unversioned.Duration{} - } else { - yyv84 := &x.UDPIdleTimeout - yym85 := z.DecBinary() - _ = yym85 - if false { - } else if z.HasExtensions() && z.DecExt(yyv84) { - } else if !yym85 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv84) - } else { - z.DecFallback(yyv84, false) - } - } - case "conntrackMax": - if r.TryDecodeAsNil() { - x.ConntrackMax = 0 - } else { - x.ConntrackMax = int32(r.DecodeInt(32)) - } - case "conntrackTCPEstablishedTimeout": - if r.TryDecodeAsNil() { - x.ConntrackTCPEstablishedTimeout = pkg1_unversioned.Duration{} - } else { - yyv87 := &x.ConntrackTCPEstablishedTimeout - yym88 := z.DecBinary() - _ = yym88 - if false { - } else if z.HasExtensions() && z.DecExt(yyv87) { - } else if !yym88 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv87) - } else { - z.DecFallback(yyv87, false) - } - } - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys67) - } // end switch yys67 - } // end for yyj67 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *KubeProxyConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj91 int - var yyb91 bool - var yyhl91 bool = l >= 0 - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.BindAddress = "" - } else { - x.BindAddress = string(r.DecodeString()) - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.HealthzBindAddress = "" - } else { - x.HealthzBindAddress = string(r.DecodeString()) - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.HealthzPort = 0 - } else { - x.HealthzPort = int32(r.DecodeInt(32)) - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.HostnameOverride = "" - } else { - x.HostnameOverride = string(r.DecodeString()) - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.IPTablesMasqueradeBit != nil { - x.IPTablesMasqueradeBit = nil - } - } else { - if x.IPTablesMasqueradeBit == nil { - x.IPTablesMasqueradeBit = new(int32) - } - yym97 := z.DecBinary() - _ = yym97 - if false { - } else { - *((*int32)(x.IPTablesMasqueradeBit)) = int32(r.DecodeInt(32)) - } - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.IPTablesSyncPeriod = pkg1_unversioned.Duration{} - } else { - yyv98 := &x.IPTablesSyncPeriod - yym99 := z.DecBinary() - _ = yym99 - if false { - } else if z.HasExtensions() && z.DecExt(yyv98) { - } else if !yym99 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv98) - } else { - z.DecFallback(yyv98, false) - } - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.KubeconfigPath = "" - } else { - x.KubeconfigPath = string(r.DecodeString()) - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.MasqueradeAll = false - } else { - x.MasqueradeAll = bool(r.DecodeBool()) - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Master = "" - } else { - x.Master = string(r.DecodeString()) - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.OOMScoreAdj != nil { - x.OOMScoreAdj = nil - } - } else { - if x.OOMScoreAdj == nil { - x.OOMScoreAdj = new(int32) - } - yym104 := z.DecBinary() - _ = yym104 - if false { - } else { - *((*int32)(x.OOMScoreAdj)) = int32(r.DecodeInt(32)) - } - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Mode = "" - } else { - x.Mode = ProxyMode(r.DecodeString()) - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.PortRange = "" - } else { - x.PortRange = string(r.DecodeString()) - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ResourceContainer = "" - } else { - x.ResourceContainer = string(r.DecodeString()) - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.UDPIdleTimeout = pkg1_unversioned.Duration{} - } else { - yyv108 := &x.UDPIdleTimeout - yym109 := z.DecBinary() - _ = yym109 - if false { - } else if z.HasExtensions() && z.DecExt(yyv108) { - } else if !yym109 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv108) - } else { - z.DecFallback(yyv108, false) - } - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ConntrackMax = 0 - } else { - x.ConntrackMax = int32(r.DecodeInt(32)) - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.ConntrackTCPEstablishedTimeout = pkg1_unversioned.Duration{} - } else { - yyv111 := &x.ConntrackTCPEstablishedTimeout - yym112 := z.DecBinary() - _ = yym112 - if false { - } else if z.HasExtensions() && z.DecExt(yyv111) { - } else if !yym112 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv111) - } else { - z.DecFallback(yyv111, false) - } - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - for { - yyj91++ - if yyhl91 { - yyb91 = yyj91 > l - } else { - yyb91 = r.CheckBreak() - } - if yyb91 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj91-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x ProxyMode) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - yym115 := z.EncBinary() - _ = yym115 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x)) - } -} - -func (x *ProxyMode) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym116 := z.DecBinary() - _ = yym116 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - *((*string)(x)) = r.DecodeString() - } -} - -func (x *KubeSchedulerConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym117 := z.EncBinary() - _ = yym117 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep118 := !z.EncBinary() - yy2arr118 := z.EncBasicHandle().StructToArray - var yyq118 [11]bool - _, _, _ = yysep118, yyq118, yy2arr118 - const yyr118 bool = false - yyq118[9] = x.Kind != "" - yyq118[10] = x.APIVersion != "" - var yynn118 int - if yyr118 || yy2arr118 { - r.EncodeArrayStart(11) - } else { - yynn118 = 9 - for _, b := range yyq118 { - if b { - yynn118++ - } - } - r.EncodeMapStart(yynn118) - yynn118 = 0 - } - if yyr118 || yy2arr118 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym120 := z.EncBinary() - _ = yym120 - if false { - } else { - r.EncodeInt(int64(x.Port)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("port")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym121 := z.EncBinary() - _ = yym121 - if false { - } else { - r.EncodeInt(int64(x.Port)) - } - } - if yyr118 || yy2arr118 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym123 := z.EncBinary() - _ = yym123 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Address)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("address")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym124 := z.EncBinary() - _ = yym124 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Address)) - } - } - if yyr118 || yy2arr118 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym126 := z.EncBinary() - _ = yym126 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.AlgorithmProvider)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("algorithmProvider")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym127 := z.EncBinary() - _ = yym127 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.AlgorithmProvider)) - } - } - if yyr118 || yy2arr118 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym129 := z.EncBinary() - _ = yym129 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.PolicyConfigFile)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("policyConfigFile")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym130 := z.EncBinary() - _ = yym130 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.PolicyConfigFile)) - } - } - if yyr118 || yy2arr118 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.EnableProfiling == nil { - r.EncodeNil() - } else { - yy132 := *x.EnableProfiling - yym133 := z.EncBinary() - _ = yym133 - if false { - } else { - r.EncodeBool(bool(yy132)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("enableProfiling")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.EnableProfiling == nil { - r.EncodeNil() - } else { - yy134 := *x.EnableProfiling - yym135 := z.EncBinary() - _ = yym135 - if false { - } else { - r.EncodeBool(bool(yy134)) - } - } - } - if yyr118 || yy2arr118 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym137 := z.EncBinary() - _ = yym137 - if false { - } else { - r.EncodeFloat32(float32(x.KubeAPIQPS)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kubeAPIQPS")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym138 := z.EncBinary() - _ = yym138 - if false { - } else { - r.EncodeFloat32(float32(x.KubeAPIQPS)) - } - } - if yyr118 || yy2arr118 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym140 := z.EncBinary() - _ = yym140 - if false { - } else { - r.EncodeInt(int64(x.KubeAPIBurst)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kubeAPIBurst")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym141 := z.EncBinary() - _ = yym141 - if false { - } else { - r.EncodeInt(int64(x.KubeAPIBurst)) - } - } - if yyr118 || yy2arr118 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yym143 := z.EncBinary() - _ = yym143 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.SchedulerName)) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("schedulerName")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym144 := z.EncBinary() - _ = yym144 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.SchedulerName)) - } - } - if yyr118 || yy2arr118 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy146 := &x.LeaderElection - yy146.CodecEncodeSelf(e) - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("leaderElection")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy147 := &x.LeaderElection - yy147.CodecEncodeSelf(e) - } - if yyr118 || yy2arr118 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq118[9] { - yym149 := z.EncBinary() - _ = yym149 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq118[9] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("kind")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym150 := z.EncBinary() - _ = yym150 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.Kind)) - } - } - } - if yyr118 || yy2arr118 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if yyq118[10] { - yym152 := z.EncBinary() - _ = yym152 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } else { - r.EncodeString(codecSelferC_UTF81234, "") - } - } else { - if yyq118[10] { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("apiVersion")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yym153 := z.EncBinary() - _ = yym153 - if false { - } else { - r.EncodeString(codecSelferC_UTF81234, string(x.APIVersion)) - } - } - } - if yyr118 || yy2arr118 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *KubeSchedulerConfiguration) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym154 := z.DecBinary() - _ = yym154 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct155 := r.ContainerType() - if yyct155 == codecSelferValueTypeMap1234 { - yyl155 := r.ReadMapStart() - if yyl155 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl155, d) - } - } else if yyct155 == codecSelferValueTypeArray1234 { - yyl155 := r.ReadArrayStart() - if yyl155 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl155, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *KubeSchedulerConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys156Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys156Slc - var yyhl156 bool = l >= 0 - for yyj156 := 0; ; yyj156++ { - if yyhl156 { - if yyj156 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys156Slc = r.DecodeBytes(yys156Slc, true, true) - yys156 := string(yys156Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys156 { - case "port": - if r.TryDecodeAsNil() { - x.Port = 0 - } else { - x.Port = int(r.DecodeInt(codecSelferBitsize1234)) - } - case "address": - if r.TryDecodeAsNil() { - x.Address = "" - } else { - x.Address = string(r.DecodeString()) - } - case "algorithmProvider": - if r.TryDecodeAsNil() { - x.AlgorithmProvider = "" - } else { - x.AlgorithmProvider = string(r.DecodeString()) - } - case "policyConfigFile": - if r.TryDecodeAsNil() { - x.PolicyConfigFile = "" - } else { - x.PolicyConfigFile = string(r.DecodeString()) - } - case "enableProfiling": - if r.TryDecodeAsNil() { - if x.EnableProfiling != nil { - x.EnableProfiling = nil - } - } else { - if x.EnableProfiling == nil { - x.EnableProfiling = new(bool) - } - yym162 := z.DecBinary() - _ = yym162 - if false { - } else { - *((*bool)(x.EnableProfiling)) = r.DecodeBool() - } - } - case "kubeAPIQPS": - if r.TryDecodeAsNil() { - x.KubeAPIQPS = 0 - } else { - x.KubeAPIQPS = float32(r.DecodeFloat(true)) - } - case "kubeAPIBurst": - if r.TryDecodeAsNil() { - x.KubeAPIBurst = 0 - } else { - x.KubeAPIBurst = int(r.DecodeInt(codecSelferBitsize1234)) - } - case "schedulerName": - if r.TryDecodeAsNil() { - x.SchedulerName = "" - } else { - x.SchedulerName = string(r.DecodeString()) - } - case "leaderElection": - if r.TryDecodeAsNil() { - x.LeaderElection = LeaderElectionConfiguration{} - } else { - yyv166 := &x.LeaderElection - yyv166.CodecDecodeSelf(d) - } - case "kind": - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - case "apiVersion": - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - default: - z.DecStructFieldNotFound(-1, yys156) - } // end switch yys156 - } // end for yyj156 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *KubeSchedulerConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj169 int - var yyb169 bool - var yyhl169 bool = l >= 0 - yyj169++ - if yyhl169 { - yyb169 = yyj169 > l - } else { - yyb169 = r.CheckBreak() - } - if yyb169 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Port = 0 - } else { - x.Port = int(r.DecodeInt(codecSelferBitsize1234)) - } - yyj169++ - if yyhl169 { - yyb169 = yyj169 > l - } else { - yyb169 = r.CheckBreak() - } - if yyb169 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Address = "" - } else { - x.Address = string(r.DecodeString()) - } - yyj169++ - if yyhl169 { - yyb169 = yyj169 > l - } else { - yyb169 = r.CheckBreak() - } - if yyb169 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.AlgorithmProvider = "" - } else { - x.AlgorithmProvider = string(r.DecodeString()) - } - yyj169++ - if yyhl169 { - yyb169 = yyj169 > l - } else { - yyb169 = r.CheckBreak() - } - if yyb169 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.PolicyConfigFile = "" - } else { - x.PolicyConfigFile = string(r.DecodeString()) - } - yyj169++ - if yyhl169 { - yyb169 = yyj169 > l - } else { - yyb169 = r.CheckBreak() - } - if yyb169 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.EnableProfiling != nil { - x.EnableProfiling = nil - } - } else { - if x.EnableProfiling == nil { - x.EnableProfiling = new(bool) - } - yym175 := z.DecBinary() - _ = yym175 - if false { - } else { - *((*bool)(x.EnableProfiling)) = r.DecodeBool() - } - } - yyj169++ - if yyhl169 { - yyb169 = yyj169 > l - } else { - yyb169 = r.CheckBreak() - } - if yyb169 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.KubeAPIQPS = 0 - } else { - x.KubeAPIQPS = float32(r.DecodeFloat(true)) - } - yyj169++ - if yyhl169 { - yyb169 = yyj169 > l - } else { - yyb169 = r.CheckBreak() - } - if yyb169 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.KubeAPIBurst = 0 - } else { - x.KubeAPIBurst = int(r.DecodeInt(codecSelferBitsize1234)) - } - yyj169++ - if yyhl169 { - yyb169 = yyj169 > l - } else { - yyb169 = r.CheckBreak() - } - if yyb169 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.SchedulerName = "" - } else { - x.SchedulerName = string(r.DecodeString()) - } - yyj169++ - if yyhl169 { - yyb169 = yyj169 > l - } else { - yyb169 = r.CheckBreak() - } - if yyb169 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.LeaderElection = LeaderElectionConfiguration{} - } else { - yyv179 := &x.LeaderElection - yyv179.CodecDecodeSelf(d) - } - yyj169++ - if yyhl169 { - yyb169 = yyj169 > l - } else { - yyb169 = r.CheckBreak() - } - if yyb169 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.Kind = "" - } else { - x.Kind = string(r.DecodeString()) - } - yyj169++ - if yyhl169 { - yyb169 = yyj169 > l - } else { - yyb169 = r.CheckBreak() - } - if yyb169 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.APIVersion = "" - } else { - x.APIVersion = string(r.DecodeString()) - } - for { - yyj169++ - if yyhl169 { - yyb169 = yyj169 > l - } else { - yyb169 = r.CheckBreak() - } - if yyb169 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj169-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} - -func (x *LeaderElectionConfiguration) CodecEncodeSelf(e *codec1978.Encoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperEncoder(e) - _, _, _ = h, z, r - if x == nil { - r.EncodeNil() - } else { - yym182 := z.EncBinary() - _ = yym182 - if false { - } else if z.HasExtensions() && z.EncExt(x) { - } else { - yysep183 := !z.EncBinary() - yy2arr183 := z.EncBasicHandle().StructToArray - var yyq183 [4]bool - _, _, _ = yysep183, yyq183, yy2arr183 - const yyr183 bool = false - var yynn183 int - if yyr183 || yy2arr183 { - r.EncodeArrayStart(4) - } else { - yynn183 = 4 - for _, b := range yyq183 { - if b { - yynn183++ - } - } - r.EncodeMapStart(yynn183) - yynn183 = 0 - } - if yyr183 || yy2arr183 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - if x.LeaderElect == nil { - r.EncodeNil() - } else { - yy185 := *x.LeaderElect - yym186 := z.EncBinary() - _ = yym186 - if false { - } else { - r.EncodeBool(bool(yy185)) - } - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("leaderElect")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - if x.LeaderElect == nil { - r.EncodeNil() - } else { - yy187 := *x.LeaderElect - yym188 := z.EncBinary() - _ = yym188 - if false { - } else { - r.EncodeBool(bool(yy187)) - } - } - } - if yyr183 || yy2arr183 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy190 := &x.LeaseDuration - yym191 := z.EncBinary() - _ = yym191 - if false { - } else if z.HasExtensions() && z.EncExt(yy190) { - } else if !yym191 && z.IsJSONHandle() { - z.EncJSONMarshal(yy190) - } else { - z.EncFallback(yy190) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("leaseDuration")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy192 := &x.LeaseDuration - yym193 := z.EncBinary() - _ = yym193 - if false { - } else if z.HasExtensions() && z.EncExt(yy192) { - } else if !yym193 && z.IsJSONHandle() { - z.EncJSONMarshal(yy192) - } else { - z.EncFallback(yy192) - } - } - if yyr183 || yy2arr183 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy195 := &x.RenewDeadline - yym196 := z.EncBinary() - _ = yym196 - if false { - } else if z.HasExtensions() && z.EncExt(yy195) { - } else if !yym196 && z.IsJSONHandle() { - z.EncJSONMarshal(yy195) - } else { - z.EncFallback(yy195) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("renewDeadline")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy197 := &x.RenewDeadline - yym198 := z.EncBinary() - _ = yym198 - if false { - } else if z.HasExtensions() && z.EncExt(yy197) { - } else if !yym198 && z.IsJSONHandle() { - z.EncJSONMarshal(yy197) - } else { - z.EncFallback(yy197) - } - } - if yyr183 || yy2arr183 { - z.EncSendContainerState(codecSelfer_containerArrayElem1234) - yy200 := &x.RetryPeriod - yym201 := z.EncBinary() - _ = yym201 - if false { - } else if z.HasExtensions() && z.EncExt(yy200) { - } else if !yym201 && z.IsJSONHandle() { - z.EncJSONMarshal(yy200) - } else { - z.EncFallback(yy200) - } - } else { - z.EncSendContainerState(codecSelfer_containerMapKey1234) - r.EncodeString(codecSelferC_UTF81234, string("retryPeriod")) - z.EncSendContainerState(codecSelfer_containerMapValue1234) - yy202 := &x.RetryPeriod - yym203 := z.EncBinary() - _ = yym203 - if false { - } else if z.HasExtensions() && z.EncExt(yy202) { - } else if !yym203 && z.IsJSONHandle() { - z.EncJSONMarshal(yy202) - } else { - z.EncFallback(yy202) - } - } - if yyr183 || yy2arr183 { - z.EncSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - z.EncSendContainerState(codecSelfer_containerMapEnd1234) - } - } - } -} - -func (x *LeaderElectionConfiguration) CodecDecodeSelf(d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - yym204 := z.DecBinary() - _ = yym204 - if false { - } else if z.HasExtensions() && z.DecExt(x) { - } else { - yyct205 := r.ContainerType() - if yyct205 == codecSelferValueTypeMap1234 { - yyl205 := r.ReadMapStart() - if yyl205 == 0 { - z.DecSendContainerState(codecSelfer_containerMapEnd1234) - } else { - x.codecDecodeSelfFromMap(yyl205, d) - } - } else if yyct205 == codecSelferValueTypeArray1234 { - yyl205 := r.ReadArrayStart() - if yyl205 == 0 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - } else { - x.codecDecodeSelfFromArray(yyl205, d) - } - } else { - panic(codecSelferOnlyMapOrArrayEncodeToStructErr1234) - } - } -} - -func (x *LeaderElectionConfiguration) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yys206Slc = z.DecScratchBuffer() // default slice to decode into - _ = yys206Slc - var yyhl206 bool = l >= 0 - for yyj206 := 0; ; yyj206++ { - if yyhl206 { - if yyj206 >= l { - break - } - } else { - if r.CheckBreak() { - break - } - } - z.DecSendContainerState(codecSelfer_containerMapKey1234) - yys206Slc = r.DecodeBytes(yys206Slc, true, true) - yys206 := string(yys206Slc) - z.DecSendContainerState(codecSelfer_containerMapValue1234) - switch yys206 { - case "leaderElect": - if r.TryDecodeAsNil() { - if x.LeaderElect != nil { - x.LeaderElect = nil - } - } else { - if x.LeaderElect == nil { - x.LeaderElect = new(bool) - } - yym208 := z.DecBinary() - _ = yym208 - if false { - } else { - *((*bool)(x.LeaderElect)) = r.DecodeBool() - } - } - case "leaseDuration": - if r.TryDecodeAsNil() { - x.LeaseDuration = pkg1_unversioned.Duration{} - } else { - yyv209 := &x.LeaseDuration - yym210 := z.DecBinary() - _ = yym210 - if false { - } else if z.HasExtensions() && z.DecExt(yyv209) { - } else if !yym210 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv209) - } else { - z.DecFallback(yyv209, false) - } - } - case "renewDeadline": - if r.TryDecodeAsNil() { - x.RenewDeadline = pkg1_unversioned.Duration{} - } else { - yyv211 := &x.RenewDeadline - yym212 := z.DecBinary() - _ = yym212 - if false { - } else if z.HasExtensions() && z.DecExt(yyv211) { - } else if !yym212 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv211) - } else { - z.DecFallback(yyv211, false) - } - } - case "retryPeriod": - if r.TryDecodeAsNil() { - x.RetryPeriod = pkg1_unversioned.Duration{} - } else { - yyv213 := &x.RetryPeriod - yym214 := z.DecBinary() - _ = yym214 - if false { - } else if z.HasExtensions() && z.DecExt(yyv213) { - } else if !yym214 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv213) - } else { - z.DecFallback(yyv213, false) - } - } - default: - z.DecStructFieldNotFound(-1, yys206) - } // end switch yys206 - } // end for yyj206 - z.DecSendContainerState(codecSelfer_containerMapEnd1234) -} - -func (x *LeaderElectionConfiguration) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { - var h codecSelfer1234 - z, r := codec1978.GenHelperDecoder(d) - _, _, _ = h, z, r - var yyj215 int - var yyb215 bool - var yyhl215 bool = l >= 0 - yyj215++ - if yyhl215 { - yyb215 = yyj215 > l - } else { - yyb215 = r.CheckBreak() - } - if yyb215 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - if x.LeaderElect != nil { - x.LeaderElect = nil - } - } else { - if x.LeaderElect == nil { - x.LeaderElect = new(bool) - } - yym217 := z.DecBinary() - _ = yym217 - if false { - } else { - *((*bool)(x.LeaderElect)) = r.DecodeBool() - } - } - yyj215++ - if yyhl215 { - yyb215 = yyj215 > l - } else { - yyb215 = r.CheckBreak() - } - if yyb215 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.LeaseDuration = pkg1_unversioned.Duration{} - } else { - yyv218 := &x.LeaseDuration - yym219 := z.DecBinary() - _ = yym219 - if false { - } else if z.HasExtensions() && z.DecExt(yyv218) { - } else if !yym219 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv218) - } else { - z.DecFallback(yyv218, false) - } - } - yyj215++ - if yyhl215 { - yyb215 = yyj215 > l - } else { - yyb215 = r.CheckBreak() - } - if yyb215 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.RenewDeadline = pkg1_unversioned.Duration{} - } else { - yyv220 := &x.RenewDeadline - yym221 := z.DecBinary() - _ = yym221 - if false { - } else if z.HasExtensions() && z.DecExt(yyv220) { - } else if !yym221 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv220) - } else { - z.DecFallback(yyv220, false) - } - } - yyj215++ - if yyhl215 { - yyb215 = yyj215 > l - } else { - yyb215 = r.CheckBreak() - } - if yyb215 { - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) - return - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - if r.TryDecodeAsNil() { - x.RetryPeriod = pkg1_unversioned.Duration{} - } else { - yyv222 := &x.RetryPeriod - yym223 := z.DecBinary() - _ = yym223 - if false { - } else if z.HasExtensions() && z.DecExt(yyv222) { - } else if !yym223 && z.IsJSONHandle() { - z.DecJSONUnmarshal(yyv222) - } else { - z.DecFallback(yyv222, false) - } - } - for { - yyj215++ - if yyhl215 { - yyb215 = yyj215 > l - } else { - yyb215 = r.CheckBreak() - } - if yyb215 { - break - } - z.DecSendContainerState(codecSelfer_containerArrayElem1234) - z.DecStructFieldNotFound(yyj215-1, "") - } - z.DecSendContainerState(codecSelfer_containerArrayEnd1234) -} diff --git a/pkg/kubelet/cm/container_manager.go b/pkg/kubelet/cm/container_manager.go index db037ac18c6..9ee4ef42908 100644 --- a/pkg/kubelet/cm/container_manager.go +++ b/pkg/kubelet/cm/container_manager.go @@ -27,17 +27,17 @@ type ContainerManager interface { // - Creates the system container where all non-containerized processes run. Start() error - // Returns resources allocated to system containers in the machine. - // These containers include the system and Kubernetes services. - SystemContainersLimit() api.ResourceList + // Returns resources allocated to system cgroups in the machine. + // These cgroups include the system and Kubernetes services. + SystemCgroupsLimit() api.ResourceList // Returns a NodeConfig that is being used by the container manager. GetNodeConfig() NodeConfig } type NodeConfig struct { - RuntimeContainerName string - SystemContainerName string - KubeletContainerName string - ContainerRuntime string + RuntimeCgroupsName string + SystemCgroupsName string + KubeletCgroupsName string + ContainerRuntime string } diff --git a/pkg/kubelet/cm/container_manager_linux.go b/pkg/kubelet/cm/container_manager_linux.go index 79200a5bb44..43fa7bedb15 100644 --- a/pkg/kubelet/cm/container_manager_linux.go +++ b/pkg/kubelet/cm/container_manager_linux.go @@ -66,7 +66,7 @@ type systemContainer struct { manager *fs.Manager } -func newSystemContainer(containerName string) *systemContainer { +func newSystemCgroups(containerName string) *systemContainer { return &systemContainer{ name: containerName, manager: createManager(containerName), @@ -193,8 +193,8 @@ func (cm *containerManagerImpl) setupNode() error { systemContainers := []*systemContainer{} if cm.ContainerRuntime == "docker" { - if cm.RuntimeContainerName != "" { - cont := newSystemContainer(cm.RuntimeContainerName) + if cm.RuntimeCgroupsName != "" { + cont := newSystemCgroups(cm.RuntimeCgroupsName) info, err := cm.cadvisorInterface.MachineInfo() var capacity = api.ResourceList{} if err != nil { @@ -203,16 +203,16 @@ func (cm *containerManagerImpl) setupNode() error { } memoryLimit := (int64(capacity.Memory().Value() * DockerMemoryLimitThresholdPercent / 100)) if memoryLimit < MinDockerMemoryLimit { - glog.Warningf("Memory limit %d for container %s is too small, reset it to %d", memoryLimit, cm.RuntimeContainerName, MinDockerMemoryLimit) + glog.Warningf("Memory limit %d for container %s is too small, reset it to %d", memoryLimit, cm.RuntimeCgroupsName, MinDockerMemoryLimit) memoryLimit = MinDockerMemoryLimit } - glog.V(2).Infof("Configure resource-only container %s with memory limit: %d", cm.RuntimeContainerName, memoryLimit) + glog.V(2).Infof("Configure resource-only container %s with memory limit: %d", cm.RuntimeCgroupsName, memoryLimit) dockerContainer := &fs.Manager{ Cgroups: &configs.Cgroup{ Parent: "/", - Name: cm.RuntimeContainerName, + Name: cm.RuntimeCgroupsName, Resources: &configs.Resources{ Memory: memoryLimit, MemorySwap: -1, @@ -229,16 +229,16 @@ func (cm *containerManagerImpl) setupNode() error { if err != nil { glog.Error(err) } else { - cm.RuntimeContainerName = cont + cm.RuntimeCgroupsName = cont } } } - if cm.SystemContainerName != "" { - if cm.SystemContainerName == "/" { + if cm.SystemCgroupsName != "" { + if cm.SystemCgroupsName == "/" { return fmt.Errorf("system container cannot be root (\"/\")") } - cont := newSystemContainer(cm.SystemContainerName) + cont := newSystemCgroups(cm.SystemCgroupsName) rootContainer := &fs.Manager{ Cgroups: &configs.Cgroup{ Parent: "/", @@ -246,17 +246,17 @@ func (cm *containerManagerImpl) setupNode() error { }, } cont.ensureStateFunc = func(manager *fs.Manager) error { - return ensureSystemContainer(rootContainer, manager) + return ensureSystemCgroups(rootContainer, manager) } systemContainers = append(systemContainers, cont) } - if cm.KubeletContainerName != "" { - cont := newSystemContainer(cm.KubeletContainerName) + if cm.KubeletCgroupsName != "" { + cont := newSystemCgroups(cm.KubeletCgroupsName) manager := fs.Manager{ Cgroups: &configs.Cgroup{ Parent: "/", - Name: cm.KubeletContainerName, + Name: cm.KubeletCgroupsName, Resources: &configs.Resources{ AllowAllDevices: true, }, @@ -271,7 +271,7 @@ func (cm *containerManagerImpl) setupNode() error { if err != nil { glog.Error("failed to find cgroups of kubelet - %v", err) } else { - cm.KubeletContainerName = cont + cm.KubeletCgroupsName = cont } } @@ -328,7 +328,7 @@ func (cm *containerManagerImpl) Start() error { return nil } -func (cm *containerManagerImpl) SystemContainersLimit() api.ResourceList { +func (cm *containerManagerImpl) SystemCgroupsLimit() api.ResourceList { cpuLimit := int64(0) // Sum up resources of all external containers. @@ -435,7 +435,7 @@ func getContainer(pid int) (string, error) { // The reason of leaving kernel threads at root cgroup is that we don't want to tie the // execution of these threads with to-be defined /system quota and create priority inversions. // -func ensureSystemContainer(rootContainer *fs.Manager, manager *fs.Manager) error { +func ensureSystemCgroups(rootContainer *fs.Manager, manager *fs.Manager) error { // Move non-kernel PIDs to the system container. attemptsRemaining := 10 var errs []error diff --git a/pkg/kubelet/cm/container_manager_stub.go b/pkg/kubelet/cm/container_manager_stub.go index 9f757b830bb..c79ae885083 100644 --- a/pkg/kubelet/cm/container_manager_stub.go +++ b/pkg/kubelet/cm/container_manager_stub.go @@ -30,7 +30,7 @@ func (cm *containerManagerStub) Start() error { return nil } -func (cm *containerManagerStub) SystemContainersLimit() api.ResourceList { +func (cm *containerManagerStub) SystemCgroupsLimit() api.ResourceList { return api.ResourceList{} } diff --git a/pkg/kubelet/cm/container_manager_unsupported.go b/pkg/kubelet/cm/container_manager_unsupported.go index 5043bc2d44b..99114004d2d 100644 --- a/pkg/kubelet/cm/container_manager_unsupported.go +++ b/pkg/kubelet/cm/container_manager_unsupported.go @@ -35,7 +35,7 @@ func (unsupportedContainerManager) Start() error { return fmt.Errorf("Container Manager is unsupported in this build") } -func (unsupportedContainerManager) SystemContainersLimit() api.ResourceList { +func (unsupportedContainerManager) SystemCgroupsLimit() api.ResourceList { return api.ResourceList{} } diff --git a/pkg/kubelet/server/stats/summary.go b/pkg/kubelet/server/stats/summary.go index d9edf74ceea..c24cb768b71 100644 --- a/pkg/kubelet/server/stats/summary.go +++ b/pkg/kubelet/server/stats/summary.go @@ -119,9 +119,9 @@ func (sb *summaryBuilder) build() (*Summary, error) { } systemContainers := map[string]string{ - SystemContainerKubelet: sb.nodeConfig.KubeletContainerName, - SystemContainerRuntime: sb.nodeConfig.RuntimeContainerName, - SystemContainerMisc: sb.nodeConfig.SystemContainerName, + SystemContainerKubelet: sb.nodeConfig.KubeletCgroupsName, + SystemContainerRuntime: sb.nodeConfig.RuntimeCgroupsName, + SystemContainerMisc: sb.nodeConfig.SystemCgroupsName, } for sys, name := range systemContainers { if info, ok := sb.infos[name]; ok { diff --git a/pkg/kubelet/server/stats/summary_test.go b/pkg/kubelet/server/stats/summary_test.go index b5854586f53..984ae52d587 100644 --- a/pkg/kubelet/server/stats/summary_test.go +++ b/pkg/kubelet/server/stats/summary_test.go @@ -48,9 +48,9 @@ func TestBuildSummary(t *testing.T) { node := api.Node{} node.Name = "FooNode" nodeConfig := cm.NodeConfig{ - RuntimeContainerName: "/docker-daemon", - SystemContainerName: "/system", - KubeletContainerName: "/kubelet", + RuntimeCgroupsName: "/docker-daemon", + SystemCgroupsName: "/system", + KubeletCgroupsName: "/kubelet", } const ( namespace0 = "test0"