
- Changes the following KubeletConfiguration fields from `string` to `map[string]string`: - `EvictionHard` - `EvictionSoft` - `EvictionSoftGracePeriod` - `EvictionMinimumReclaim` - Adds flag parsing shims to maintain Kubelet's public flags API, while enabling structured input in the file API. - Also removes `kubeletconfig.ConfigurationMap`, which was an ad-hoc flag parsing shim living in the kubeletconfig API group, and replaces it with the `MapStringString` shim introduced in this PR. Flag parsing shims belong in a common place, not in the kubeletconfig API. I manually audited these to ensure that this wouldn't cause errors parsing the command line for syntax that would have previously been error free (`kubeletconfig.ConfigurationMap` was unique in that it allowed keys to be provided on the CLI without values. I believe this was done in `flags.ConfigurationMap` to facilitate the `--node-labels` flag, which rightfully accepts value-free keys, and that this shim was then just copied to `kubeletconfig`). Fortunately, the affected fields (`ExperimentalQOSReserved`, `SystemReserved`, and `KubeReserved`) expect non-empty strings in the values of the map, and as a result passing the empty string is already an error. Thus requiring keys shouldn't break anyone's scripts. - Updates code and tests accordingly. Regarding eviction operators, directionality is already implicit in the signal type (for a given signal, the decision to evict will be made when crossing the threshold from either above or below, never both). There is no need to expose an operator, such as `<`, in the API. By changing `EvictionHard` and `EvictionSoft` to `map[string]string`, this PR simplifies the experience of working with these fields via the `KubeletConfiguration` type. Again, flags stay the same. Other things: - There is another flag parsing shim, `flags.ConfigurationMap`, from the shared flag utility. The `NodeLabels` field still uses `flags.ConfigurationMap`. This PR moves the allocation of the `map[string]string` for the `NodeLabels` field from `AddKubeletConfigFlags` to the defaulter for the external `KubeletConfiguration` type. Flags are layered on top of an internal object that has undergone conversion from a defaulted external object, which means that previously the mere registration of flags would have overwritten any previously-defined defaults for `NodeLabels` (fortunately there were none).
263 lines
7.9 KiB
Go
Generated
263 lines
7.9 KiB
Go
Generated
// +build !ignore_autogenerated
|
|
|
|
/*
|
|
Copyright 2017 The Kubernetes Authors.
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
// This file was autogenerated by deepcopy-gen. Do not edit it manually!
|
|
|
|
package kubeletconfig
|
|
|
|
import (
|
|
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
|
runtime "k8s.io/apimachinery/pkg/runtime"
|
|
)
|
|
|
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
func (in *KubeletAnonymousAuthentication) DeepCopyInto(out *KubeletAnonymousAuthentication) {
|
|
*out = *in
|
|
return
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletAnonymousAuthentication.
|
|
func (in *KubeletAnonymousAuthentication) DeepCopy() *KubeletAnonymousAuthentication {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(KubeletAnonymousAuthentication)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
func (in *KubeletAuthentication) DeepCopyInto(out *KubeletAuthentication) {
|
|
*out = *in
|
|
out.X509 = in.X509
|
|
out.Webhook = in.Webhook
|
|
out.Anonymous = in.Anonymous
|
|
return
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletAuthentication.
|
|
func (in *KubeletAuthentication) DeepCopy() *KubeletAuthentication {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(KubeletAuthentication)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
func (in *KubeletAuthorization) DeepCopyInto(out *KubeletAuthorization) {
|
|
*out = *in
|
|
out.Webhook = in.Webhook
|
|
return
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletAuthorization.
|
|
func (in *KubeletAuthorization) DeepCopy() *KubeletAuthorization {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(KubeletAuthorization)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
func (in *KubeletConfiguration) DeepCopyInto(out *KubeletConfiguration) {
|
|
*out = *in
|
|
out.TypeMeta = in.TypeMeta
|
|
if in.ConfigTrialDuration != nil {
|
|
in, out := &in.ConfigTrialDuration, &out.ConfigTrialDuration
|
|
if *in == nil {
|
|
*out = nil
|
|
} else {
|
|
*out = new(v1.Duration)
|
|
**out = **in
|
|
}
|
|
}
|
|
out.SyncFrequency = in.SyncFrequency
|
|
out.FileCheckFrequency = in.FileCheckFrequency
|
|
out.HTTPCheckFrequency = in.HTTPCheckFrequency
|
|
if in.ManifestURLHeader != nil {
|
|
in, out := &in.ManifestURLHeader, &out.ManifestURLHeader
|
|
*out = make(map[string][]string, len(*in))
|
|
for key, val := range *in {
|
|
if val == nil {
|
|
(*out)[key] = nil
|
|
} else {
|
|
(*out)[key] = make([]string, len(val))
|
|
copy((*out)[key], val)
|
|
}
|
|
}
|
|
}
|
|
out.Authentication = in.Authentication
|
|
out.Authorization = in.Authorization
|
|
if in.HostNetworkSources != nil {
|
|
in, out := &in.HostNetworkSources, &out.HostNetworkSources
|
|
*out = make([]string, len(*in))
|
|
copy(*out, *in)
|
|
}
|
|
if in.HostPIDSources != nil {
|
|
in, out := &in.HostPIDSources, &out.HostPIDSources
|
|
*out = make([]string, len(*in))
|
|
copy(*out, *in)
|
|
}
|
|
if in.HostIPCSources != nil {
|
|
in, out := &in.HostIPCSources, &out.HostIPCSources
|
|
*out = make([]string, len(*in))
|
|
copy(*out, *in)
|
|
}
|
|
if in.ClusterDNS != nil {
|
|
in, out := &in.ClusterDNS, &out.ClusterDNS
|
|
*out = make([]string, len(*in))
|
|
copy(*out, *in)
|
|
}
|
|
out.StreamingConnectionIdleTimeout = in.StreamingConnectionIdleTimeout
|
|
out.NodeStatusUpdateFrequency = in.NodeStatusUpdateFrequency
|
|
out.ImageMinimumGCAge = in.ImageMinimumGCAge
|
|
out.VolumeStatsAggPeriod = in.VolumeStatsAggPeriod
|
|
out.CPUManagerReconcilePeriod = in.CPUManagerReconcilePeriod
|
|
out.RuntimeRequestTimeout = in.RuntimeRequestTimeout
|
|
if in.EvictionHard != nil {
|
|
in, out := &in.EvictionHard, &out.EvictionHard
|
|
*out = make(map[string]string, len(*in))
|
|
for key, val := range *in {
|
|
(*out)[key] = val
|
|
}
|
|
}
|
|
if in.EvictionSoft != nil {
|
|
in, out := &in.EvictionSoft, &out.EvictionSoft
|
|
*out = make(map[string]string, len(*in))
|
|
for key, val := range *in {
|
|
(*out)[key] = val
|
|
}
|
|
}
|
|
if in.EvictionSoftGracePeriod != nil {
|
|
in, out := &in.EvictionSoftGracePeriod, &out.EvictionSoftGracePeriod
|
|
*out = make(map[string]string, len(*in))
|
|
for key, val := range *in {
|
|
(*out)[key] = val
|
|
}
|
|
}
|
|
out.EvictionPressureTransitionPeriod = in.EvictionPressureTransitionPeriod
|
|
if in.EvictionMinimumReclaim != nil {
|
|
in, out := &in.EvictionMinimumReclaim, &out.EvictionMinimumReclaim
|
|
*out = make(map[string]string, len(*in))
|
|
for key, val := range *in {
|
|
(*out)[key] = val
|
|
}
|
|
}
|
|
if in.FeatureGates != nil {
|
|
in, out := &in.FeatureGates, &out.FeatureGates
|
|
*out = make(map[string]bool, len(*in))
|
|
for key, val := range *in {
|
|
(*out)[key] = val
|
|
}
|
|
}
|
|
if in.SystemReserved != nil {
|
|
in, out := &in.SystemReserved, &out.SystemReserved
|
|
*out = make(map[string]string, len(*in))
|
|
for key, val := range *in {
|
|
(*out)[key] = val
|
|
}
|
|
}
|
|
if in.KubeReserved != nil {
|
|
in, out := &in.KubeReserved, &out.KubeReserved
|
|
*out = make(map[string]string, len(*in))
|
|
for key, val := range *in {
|
|
(*out)[key] = val
|
|
}
|
|
}
|
|
if in.EnforceNodeAllocatable != nil {
|
|
in, out := &in.EnforceNodeAllocatable, &out.EnforceNodeAllocatable
|
|
*out = make([]string, len(*in))
|
|
copy(*out, *in)
|
|
}
|
|
return
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletConfiguration.
|
|
func (in *KubeletConfiguration) DeepCopy() *KubeletConfiguration {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(KubeletConfiguration)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
|
|
func (in *KubeletConfiguration) DeepCopyObject() runtime.Object {
|
|
if c := in.DeepCopy(); c != nil {
|
|
return c
|
|
} else {
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
func (in *KubeletWebhookAuthentication) DeepCopyInto(out *KubeletWebhookAuthentication) {
|
|
*out = *in
|
|
out.CacheTTL = in.CacheTTL
|
|
return
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletWebhookAuthentication.
|
|
func (in *KubeletWebhookAuthentication) DeepCopy() *KubeletWebhookAuthentication {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(KubeletWebhookAuthentication)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
func (in *KubeletWebhookAuthorization) DeepCopyInto(out *KubeletWebhookAuthorization) {
|
|
*out = *in
|
|
out.CacheAuthorizedTTL = in.CacheAuthorizedTTL
|
|
out.CacheUnauthorizedTTL = in.CacheUnauthorizedTTL
|
|
return
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletWebhookAuthorization.
|
|
func (in *KubeletWebhookAuthorization) DeepCopy() *KubeletWebhookAuthorization {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(KubeletWebhookAuthorization)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|
|
|
|
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
|
func (in *KubeletX509Authentication) DeepCopyInto(out *KubeletX509Authentication) {
|
|
*out = *in
|
|
return
|
|
}
|
|
|
|
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeletX509Authentication.
|
|
func (in *KubeletX509Authentication) DeepCopy() *KubeletX509Authentication {
|
|
if in == nil {
|
|
return nil
|
|
}
|
|
out := new(KubeletX509Authentication)
|
|
in.DeepCopyInto(out)
|
|
return out
|
|
}
|