Updated references from k8s.io/{apiserver,apimachinery} to the new k8s.io/component-base repo. Co-authored-by @Klaven

pull/564/head
Lucas Käldström 2019-01-06 14:01:26 +02:00
parent 2e52d5c331
commit 0140c82c16
No known key found for this signature in database
GPG Key ID: 3FA3783D77751514
23 changed files with 71 additions and 82 deletions

View File

@ -21,8 +21,7 @@ limitations under the License.
// +k8s:deepcopy-gen=package // +k8s:deepcopy-gen=package
// +k8s:conversion-gen=k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config // +k8s:conversion-gen=k8s.io/kubernetes/cmd/cloud-controller-manager/app/apis/config
// +k8s:conversion-gen=k8s.io/apimachinery/pkg/apis/config/v1alpha1 // +k8s:conversion-gen=k8s.io/component-base/config/v1alpha1
// +k8s:conversion-gen=k8s.io/apiserver/pkg/apis/config/v1alpha1
// +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1 // +k8s:conversion-gen=k8s.io/kubernetes/pkg/controller/apis/config/v1alpha1
// +k8s:openapi-gen=true // +k8s:openapi-gen=true
// +k8s:defaulter-gen=TypeMeta // +k8s:defaulter-gen=TypeMeta

View File

@ -24,11 +24,10 @@ import (
"github.com/spf13/pflag" "github.com/spf13/pflag"
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"
apiserverconfig "k8s.io/apiserver/pkg/apis/config"
apiserveroptions "k8s.io/apiserver/pkg/server/options" apiserveroptions "k8s.io/apiserver/pkg/server/options"
componentbaseconfig "k8s.io/component-base/config"
cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options" cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options"
) )
@ -40,13 +39,13 @@ func TestDefaultFlags(t *testing.T) {
Port: DefaultInsecureCloudControllerManagerPort, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config Port: DefaultInsecureCloudControllerManagerPort, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod: metav1.Duration{Duration: 12 * time.Hour}, MinResyncPeriod: metav1.Duration{Duration: 12 * time.Hour},
ClientConnection: apimachineryconfig.ClientConnectionConfiguration{ ClientConnection: componentbaseconfig.ClientConnectionConfiguration{
ContentType: "application/vnd.kubernetes.protobuf", ContentType: "application/vnd.kubernetes.protobuf",
QPS: 20.0, QPS: 20.0,
Burst: 30, Burst: 30,
}, },
ControllerStartInterval: metav1.Duration{Duration: 0}, ControllerStartInterval: metav1.Duration{Duration: 0},
LeaderElection: apiserverconfig.LeaderElectionConfiguration{ LeaderElection: componentbaseconfig.LeaderElectionConfiguration{
ResourceLock: "endpoints", ResourceLock: "endpoints",
LeaderElect: true, LeaderElect: true,
LeaseDuration: metav1.Duration{Duration: 15 * time.Second}, LeaseDuration: metav1.Duration{Duration: 15 * time.Second},
@ -158,13 +157,13 @@ func TestAddFlags(t *testing.T) {
Port: DefaultInsecureCloudControllerManagerPort, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config Port: DefaultInsecureCloudControllerManagerPort, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod: metav1.Duration{Duration: 100 * time.Minute}, MinResyncPeriod: metav1.Duration{Duration: 100 * time.Minute},
ClientConnection: apimachineryconfig.ClientConnectionConfiguration{ ClientConnection: componentbaseconfig.ClientConnectionConfiguration{
ContentType: "application/vnd.kubernetes.protobuf", ContentType: "application/vnd.kubernetes.protobuf",
QPS: 50.0, QPS: 50.0,
Burst: 100, Burst: 100,
}, },
ControllerStartInterval: metav1.Duration{Duration: 2 * time.Minute}, ControllerStartInterval: metav1.Duration{Duration: 2 * time.Minute},
LeaderElection: apiserverconfig.LeaderElectionConfiguration{ LeaderElection: componentbaseconfig.LeaderElectionConfiguration{
ResourceLock: "configmap", ResourceLock: "configmap",
LeaderElect: false, LeaderElect: false,
LeaseDuration: metav1.Duration{Duration: 30 * time.Second}, LeaseDuration: metav1.Duration{Duration: 30 * time.Second},

View File

@ -19,7 +19,7 @@ package options
import ( import (
"github.com/spf13/pflag" "github.com/spf13/pflag"
apiserverconfig "k8s.io/apiserver/pkg/apis/config" componentbaseconfig "k8s.io/component-base/config"
) )
// DebuggingOptions holds the Debugging options. // DebuggingOptions holds the Debugging options.
@ -41,7 +41,7 @@ func (o *DebuggingOptions) AddFlags(fs *pflag.FlagSet) {
} }
// ApplyTo fills up Debugging config with options. // ApplyTo fills up Debugging config with options.
func (o *DebuggingOptions) ApplyTo(cfg *apiserverconfig.DebuggingConfiguration) error { func (o *DebuggingOptions) ApplyTo(cfg *componentbaseconfig.DebuggingConfiguration) error {
if o == nil { if o == nil {
return nil return nil
} }

View File

@ -20,11 +20,10 @@ import (
"fmt" "fmt"
"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"
"k8s.io/apimachinery/pkg/util/sets" "k8s.io/apimachinery/pkg/util/sets"
apiserverconfig "k8s.io/apiserver/pkg/apis/config"
apiserverflag "k8s.io/apiserver/pkg/util/flag" apiserverflag "k8s.io/apiserver/pkg/util/flag"
componentbaseconfig "k8s.io/component-base/config"
"k8s.io/kubernetes/pkg/client/leaderelectionconfig" "k8s.io/kubernetes/pkg/client/leaderelectionconfig"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
) )
@ -34,9 +33,9 @@ type GenericControllerManagerConfigurationOptions struct {
Port int32 Port int32
Address string Address string
MinResyncPeriod metav1.Duration MinResyncPeriod metav1.Duration
ClientConnection apimachineryconfig.ClientConnectionConfiguration ClientConnection componentbaseconfig.ClientConnectionConfiguration
ControllerStartInterval metav1.Duration ControllerStartInterval metav1.Duration
LeaderElection apiserverconfig.LeaderElectionConfiguration LeaderElection componentbaseconfig.LeaderElectionConfiguration
Debugging *DebuggingOptions Debugging *DebuggingOptions
Controllers []string Controllers []string
} }

View File

@ -21,7 +21,6 @@ import (
"net/http" "net/http"
goruntime "runtime" goruntime "runtime"
apiserverconfig "k8s.io/apiserver/pkg/apis/config"
genericapifilters "k8s.io/apiserver/pkg/endpoints/filters" genericapifilters "k8s.io/apiserver/pkg/endpoints/filters"
apirequest "k8s.io/apiserver/pkg/endpoints/request" apirequest "k8s.io/apiserver/pkg/endpoints/request"
apiserver "k8s.io/apiserver/pkg/server" apiserver "k8s.io/apiserver/pkg/server"
@ -29,6 +28,7 @@ import (
"k8s.io/apiserver/pkg/server/healthz" "k8s.io/apiserver/pkg/server/healthz"
"k8s.io/apiserver/pkg/server/mux" "k8s.io/apiserver/pkg/server/mux"
"k8s.io/apiserver/pkg/server/routes" "k8s.io/apiserver/pkg/server/routes"
componentbaseconfig "k8s.io/component-base/config"
"k8s.io/kubernetes/pkg/api/legacyscheme" "k8s.io/kubernetes/pkg/api/legacyscheme"
"k8s.io/kubernetes/pkg/util/configz" "k8s.io/kubernetes/pkg/util/configz"
) )
@ -52,7 +52,7 @@ func BuildHandlerChain(apiHandler http.Handler, authorizationInfo *apiserver.Aut
} }
// NewBaseHandler takes in CompletedConfig and returns a handler. // NewBaseHandler takes in CompletedConfig and returns a handler.
func NewBaseHandler(c *apiserverconfig.DebuggingConfiguration, checks ...healthz.HealthzChecker) *mux.PathRecorderMux { func NewBaseHandler(c *componentbaseconfig.DebuggingConfiguration, checks ...healthz.HealthzChecker) *mux.PathRecorderMux {
mux := mux.NewPathRecorderMux("controller-manager") mux := mux.NewPathRecorderMux("controller-manager")
healthz.InstallHandler(mux, checks...) healthz.InstallHandler(mux, checks...)
if c.EnableProfiling { if c.EnableProfiling {

View File

@ -25,11 +25,10 @@ import (
"github.com/spf13/pflag" "github.com/spf13/pflag"
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"
apiserverconfig "k8s.io/apiserver/pkg/apis/config"
apiserveroptions "k8s.io/apiserver/pkg/server/options" apiserveroptions "k8s.io/apiserver/pkg/server/options"
componentbaseconfig "k8s.io/component-base/config"
cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options" cmoptions "k8s.io/kubernetes/cmd/controller-manager/app/options"
kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config" kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
) )
@ -128,13 +127,13 @@ func TestAddFlags(t *testing.T) {
Port: 10252, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config Port: 10252, // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config Address: "0.0.0.0", // Note: InsecureServingOptions.ApplyTo will write the flag value back into the component config
MinResyncPeriod: metav1.Duration{Duration: 8 * time.Hour}, MinResyncPeriod: metav1.Duration{Duration: 8 * time.Hour},
ClientConnection: apimachineryconfig.ClientConnectionConfiguration{ ClientConnection: componentbaseconfig.ClientConnectionConfiguration{
ContentType: "application/json", ContentType: "application/json",
QPS: 50.0, QPS: 50.0,
Burst: 100, Burst: 100,
}, },
ControllerStartInterval: metav1.Duration{Duration: 2 * time.Minute}, ControllerStartInterval: metav1.Duration{Duration: 2 * time.Minute},
LeaderElection: apiserverconfig.LeaderElectionConfiguration{ LeaderElection: componentbaseconfig.LeaderElectionConfiguration{
ResourceLock: "configmap", ResourceLock: "configmap",
LeaderElect: false, LeaderElect: false,
LeaseDuration: metav1.Duration{Duration: 30 * time.Second}, LeaseDuration: metav1.Duration{Duration: 30 * time.Second},

View File

@ -28,8 +28,7 @@ import (
"strings" "strings"
"time" "time"
"k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
apimachineryconfig "k8s.io/apimachinery/pkg/apis/config"
v1meta "k8s.io/apimachinery/pkg/apis/meta/v1" v1meta "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"
@ -48,6 +47,7 @@ import (
"k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api" clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
"k8s.io/client-go/tools/record" "k8s.io/client-go/tools/record"
componentbaseconfig "k8s.io/component-base/config"
"k8s.io/kube-proxy/config/v1alpha1" "k8s.io/kube-proxy/config/v1alpha1"
api "k8s.io/kubernetes/pkg/apis/core" api "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/kubelet/qos" "k8s.io/kubernetes/pkg/kubelet/qos"
@ -422,7 +422,7 @@ 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 apimachineryconfig.ClientConnectionConfiguration, masterOverride string) (clientset.Interface, v1core.EventsGetter, error) { func createClients(config componentbaseconfig.ClientConnectionConfiguration, masterOverride string) (clientset.Interface, v1core.EventsGetter, error) {
var kubeConfig *rest.Config var kubeConfig *rest.Config
var err error var err error

View File

@ -26,9 +26,9 @@ 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"
componentbaseconfig "k8s.io/component-base/config"
api "k8s.io/kubernetes/pkg/apis/core" api "k8s.io/kubernetes/pkg/apis/core"
kubeproxyconfig "k8s.io/kubernetes/pkg/proxy/apis/config" kubeproxyconfig "k8s.io/kubernetes/pkg/proxy/apis/config"
"k8s.io/kubernetes/pkg/util/configz" "k8s.io/kubernetes/pkg/util/configz"
@ -289,7 +289,7 @@ nodePortAddresses:
} }
expected := &kubeproxyconfig.KubeProxyConfiguration{ expected := &kubeproxyconfig.KubeProxyConfiguration{
BindAddress: expBindAddr, BindAddress: expBindAddr,
ClientConnection: apimachineryconfig.ClientConnectionConfiguration{ ClientConnection: componentbaseconfig.ClientConnectionConfiguration{
AcceptContentTypes: "abc", AcceptContentTypes: "abc",
Burst: 100, Burst: 100,
ContentType: "content-type", ContentType: "content-type",

View File

@ -24,7 +24,6 @@ import (
"time" "time"
corev1 "k8s.io/api/core/v1" corev1 "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/util/uuid" "k8s.io/apimachinery/pkg/util/uuid"
apiserveroptions "k8s.io/apiserver/pkg/server/options" apiserveroptions "k8s.io/apiserver/pkg/server/options"
@ -39,6 +38,7 @@ import (
"k8s.io/client-go/tools/leaderelection" "k8s.io/client-go/tools/leaderelection"
"k8s.io/client-go/tools/leaderelection/resourcelock" "k8s.io/client-go/tools/leaderelection/resourcelock"
"k8s.io/client-go/tools/record" "k8s.io/client-go/tools/record"
componentbaseconfig "k8s.io/component-base/config"
"k8s.io/klog" "k8s.io/klog"
kubeschedulerconfigv1alpha1 "k8s.io/kube-scheduler/config/v1alpha1" kubeschedulerconfigv1alpha1 "k8s.io/kube-scheduler/config/v1alpha1"
schedulerappconfig "k8s.io/kubernetes/cmd/kube-scheduler/app/config" schedulerappconfig "k8s.io/kubernetes/cmd/kube-scheduler/app/config"
@ -294,7 +294,7 @@ func makeLeaderElectionConfig(config kubeschedulerconfig.KubeSchedulerLeaderElec
// 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 apimachineryconfig.ClientConnectionConfiguration, masterOverride string, timeout time.Duration) (clientset.Interface, clientset.Interface, v1core.EventsGetter, error) { func createClients(config componentbaseconfig.ClientConnectionConfiguration, masterOverride string, timeout time.Duration) (clientset.Interface, clientset.Interface, v1core.EventsGetter, error) {
if len(config.Kubeconfig) == 0 && len(masterOverride) == 0 { if len(config.Kubeconfig) == 0 && len(masterOverride) == 0 {
klog.Warningf("Neither --kubeconfig nor --master was specified. Using default API client. This might not work.") klog.Warningf("Neither --kubeconfig nor --master was specified. Using default API client. This might not work.")
} }

View File

@ -28,11 +28,10 @@ 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/diff" "k8s.io/apimachinery/pkg/util/diff"
apiserverconfig "k8s.io/apiserver/pkg/apis/config"
apiserveroptions "k8s.io/apiserver/pkg/server/options" apiserveroptions "k8s.io/apiserver/pkg/server/options"
componentbaseconfig "k8s.io/component-base/config"
kubeschedulerconfig "k8s.io/kubernetes/pkg/scheduler/apis/config" kubeschedulerconfig "k8s.io/kubernetes/pkg/scheduler/apis/config"
) )
@ -209,7 +208,7 @@ users:
MetricsBindAddress: "0.0.0.0:10251", MetricsBindAddress: "0.0.0.0:10251",
FailureDomains: "kubernetes.io/hostname,failure-domain.beta.kubernetes.io/zone,failure-domain.beta.kubernetes.io/region", FailureDomains: "kubernetes.io/hostname,failure-domain.beta.kubernetes.io/zone,failure-domain.beta.kubernetes.io/region",
LeaderElection: kubeschedulerconfig.KubeSchedulerLeaderElectionConfiguration{ LeaderElection: kubeschedulerconfig.KubeSchedulerLeaderElectionConfiguration{
LeaderElectionConfiguration: apiserverconfig.LeaderElectionConfiguration{ LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{
LeaderElect: true, LeaderElect: true,
LeaseDuration: metav1.Duration{Duration: 15 * time.Second}, LeaseDuration: metav1.Duration{Duration: 15 * time.Second},
RenewDeadline: metav1.Duration{Duration: 10 * time.Second}, RenewDeadline: metav1.Duration{Duration: 10 * time.Second},
@ -219,7 +218,7 @@ users:
LockObjectNamespace: "kube-system", LockObjectNamespace: "kube-system",
LockObjectName: "kube-scheduler", LockObjectName: "kube-scheduler",
}, },
ClientConnection: apimachineryconfig.ClientConnectionConfiguration{ ClientConnection: componentbaseconfig.ClientConnectionConfiguration{
Kubeconfig: configKubeconfig, Kubeconfig: configKubeconfig,
QPS: 50, QPS: 50,
Burst: 100, Burst: 100,
@ -289,7 +288,7 @@ users:
MetricsBindAddress: "", // defaults empty when not running from config file MetricsBindAddress: "", // defaults empty when not running from config file
FailureDomains: "kubernetes.io/hostname,failure-domain.beta.kubernetes.io/zone,failure-domain.beta.kubernetes.io/region", FailureDomains: "kubernetes.io/hostname,failure-domain.beta.kubernetes.io/zone,failure-domain.beta.kubernetes.io/region",
LeaderElection: kubeschedulerconfig.KubeSchedulerLeaderElectionConfiguration{ LeaderElection: kubeschedulerconfig.KubeSchedulerLeaderElectionConfiguration{
LeaderElectionConfiguration: apiserverconfig.LeaderElectionConfiguration{ LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{
LeaderElect: true, LeaderElect: true,
LeaseDuration: metav1.Duration{Duration: 15 * time.Second}, LeaseDuration: metav1.Duration{Duration: 15 * time.Second},
RenewDeadline: metav1.Duration{Duration: 10 * time.Second}, RenewDeadline: metav1.Duration{Duration: 10 * time.Second},
@ -299,7 +298,7 @@ users:
LockObjectNamespace: "kube-system", LockObjectNamespace: "kube-system",
LockObjectName: "kube-scheduler", LockObjectName: "kube-scheduler",
}, },
ClientConnection: apimachineryconfig.ClientConnectionConfiguration{ ClientConnection: componentbaseconfig.ClientConnectionConfiguration{
Kubeconfig: flagKubeconfig, Kubeconfig: flagKubeconfig,
QPS: 50, QPS: 50,
Burst: 100, Burst: 100,

View File

@ -20,16 +20,17 @@ import (
"time" "time"
"github.com/spf13/pflag" "github.com/spf13/pflag"
apiserverconfig "k8s.io/apiserver/pkg/apis/config" componentbaseconfig "k8s.io/component-base/config"
) )
const ( const (
// DefaultLeaseDuration defines a default duration of lease. // DefaultLeaseDuration defines a default duration of lease.
// TODO: This constant should move to the k8s.io/component-base/config package
DefaultLeaseDuration = 15 * time.Second DefaultLeaseDuration = 15 * time.Second
) )
// BindFlags binds the LeaderElectionConfiguration struct fields to a flagset // BindFlags binds the LeaderElectionConfiguration struct fields to a flagset
func BindFlags(l *apiserverconfig.LeaderElectionConfiguration, fs *pflag.FlagSet) { func BindFlags(l *componentbaseconfig.LeaderElectionConfiguration, fs *pflag.FlagSet) {
fs.BoolVar(&l.LeaderElect, "leader-elect", l.LeaderElect, ""+ fs.BoolVar(&l.LeaderElect, "leader-elect", l.LeaderElect, ""+
"Start a leader election client and gain leadership before "+ "Start a leader election client and gain leadership before "+
"executing the main loop. Enable this when running replicated "+ "executing the main loop. Enable this when running replicated "+

View File

@ -17,9 +17,8 @@ limitations under the License.
package config package config
import ( import (
apimachineryconfig "k8s.io/apimachinery/pkg/apis/config"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
apiserverconfig "k8s.io/apiserver/pkg/apis/config" componentbaseconfig "k8s.io/component-base/config"
) )
// GroupResource describes an group resource. // GroupResource describes an group resource.
@ -112,11 +111,11 @@ type GenericControllerManagerConfiguration struct {
MinResyncPeriod metav1.Duration MinResyncPeriod metav1.Duration
// ClientConnection specifies the kubeconfig file and client connection // ClientConnection specifies the kubeconfig file and client connection
// settings for the proxy server to use when communicating with the apiserver. // settings for the proxy server to use when communicating with the apiserver.
ClientConnection apimachineryconfig.ClientConnectionConfiguration ClientConnection componentbaseconfig.ClientConnectionConfiguration
// How long to wait between starting controller managers // How long to wait between starting controller managers
ControllerStartInterval metav1.Duration ControllerStartInterval metav1.Duration
// leaderElection defines the configuration of leader election client. // leaderElection defines the configuration of leader election client.
LeaderElection apiserverconfig.LeaderElectionConfiguration LeaderElection componentbaseconfig.LeaderElectionConfiguration
// Controllers is the list of controllers to enable or disable // Controllers is the list of controllers to enable or disable
// '*' means "all enabled by default controllers" // '*' means "all enabled by default controllers"
// 'foo' means "enable 'foo'" // 'foo' means "enable 'foo'"
@ -124,7 +123,7 @@ type GenericControllerManagerConfiguration struct {
// first item for a particular name wins // first item for a particular name wins
Controllers []string Controllers []string
// DebuggingConfiguration holds configuration for Debugging related features. // DebuggingConfiguration holds configuration for Debugging related features.
Debugging apiserverconfig.DebuggingConfiguration Debugging componentbaseconfig.DebuggingConfiguration
} }
// KubeCloudSharedConfiguration contains elements shared by both kube-controller manager // KubeCloudSharedConfiguration contains elements shared by both kube-controller manager

View File

@ -19,10 +19,9 @@ package v1alpha1
import ( import (
"time" "time"
apimachineryconfigv1alpha1 "k8s.io/apimachinery/pkg/apis/config/v1alpha1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kruntime "k8s.io/apimachinery/pkg/runtime" kruntime "k8s.io/apimachinery/pkg/runtime"
apiserverconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1" componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1"
kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1" kubectrlmgrconfigv1alpha1 "k8s.io/kube-controller-manager/config/v1alpha1"
utilpointer "k8s.io/utils/pointer" utilpointer "k8s.io/utils/pointer"
) )
@ -52,7 +51,7 @@ func SetDefaults_KubeControllerManagerConfiguration(obj *kubectrlmgrconfigv1alph
obj.TTLAfterFinishedController.ConcurrentTTLSyncs = 5 obj.TTLAfterFinishedController.ConcurrentTTLSyncs = 5
} }
// These defaults override the recommended defaults from the apimachineryconfigv1alpha1 package that are applied automatically // These defaults override the recommended defaults from the componentbaseconfigv1alpha1 package that are applied automatically
// These client-connection defaults are specific to the kube-controller-manager // These client-connection defaults are specific to the kube-controller-manager
if obj.Generic.ClientConnection.QPS == 0.0 { if obj.Generic.ClientConnection.QPS == 0.0 {
obj.Generic.ClientConnection.QPS = 20.0 obj.Generic.ClientConnection.QPS = 20.0
@ -81,8 +80,8 @@ func RecommendedDefaultGenericControllerManagerConfiguration(obj *kubectrlmgrcon
} }
// Use the default ClientConnectionConfiguration and LeaderElectionConfiguration options // Use the default ClientConnectionConfiguration and LeaderElectionConfiguration options
apimachineryconfigv1alpha1.RecommendedDefaultClientConnectionConfiguration(&obj.ClientConnection) componentbaseconfigv1alpha1.RecommendedDefaultClientConnectionConfiguration(&obj.ClientConnection)
apiserverconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection) componentbaseconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection)
} }
func SetDefaults_KubeCloudSharedConfiguration(obj *kubectrlmgrconfigv1alpha1.KubeCloudSharedConfiguration) { func SetDefaults_KubeCloudSharedConfiguration(obj *kubectrlmgrconfigv1alpha1.KubeCloudSharedConfiguration) {

View File

@ -21,8 +21,8 @@ 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"
componentbaseconfig "k8s.io/component-base/config"
) )
// KubeProxyIPTablesConfiguration contains iptables-related configuration // KubeProxyIPTablesConfiguration contains iptables-related configuration
@ -108,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 apimachineryconfig.ClientConnectionConfiguration ClientConnection componentbaseconfig.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.

View File

@ -23,10 +23,10 @@ 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"
componentbaseconfig "k8s.io/component-base/config"
apivalidation "k8s.io/kubernetes/pkg/apis/core/validation" apivalidation "k8s.io/kubernetes/pkg/apis/core/validation"
kubeproxyconfig "k8s.io/kubernetes/pkg/proxy/apis/config" kubeproxyconfig "k8s.io/kubernetes/pkg/proxy/apis/config"
) )
@ -187,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 apimachineryconfig.ClientConnectionConfiguration, fldPath *field.Path) field.ErrorList { func validateClientConnectionConfiguration(config componentbaseconfig.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

View File

@ -23,9 +23,9 @@ 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"
componentbaseconfig "k8s.io/component-base/config"
kubeproxyconfig "k8s.io/kubernetes/pkg/proxy/apis/config" kubeproxyconfig "k8s.io/kubernetes/pkg/proxy/apis/config"
"k8s.io/utils/pointer" "k8s.io/utils/pointer"
) )
@ -575,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 := []apimachineryconfig.ClientConnectionConfiguration{ successCases := []componentbaseconfig.ClientConnectionConfiguration{
{ {
Burst: 0, Burst: 0,
}, },
@ -591,11 +591,11 @@ func TestValidateClientConnectionConfiguration(t *testing.T) {
} }
errorCases := []struct { errorCases := []struct {
ccc apimachineryconfig.ClientConnectionConfiguration ccc componentbaseconfig.ClientConnectionConfiguration
msg string msg string
}{ }{
{ {
ccc: apimachineryconfig.ClientConnectionConfiguration{Burst: -5}, ccc: componentbaseconfig.ClientConnectionConfiguration{Burst: -5},
msg: "must be greater than or equal to 0", msg: "must be greater than or equal to 0",
}, },
} }

View File

@ -17,9 +17,8 @@ limitations under the License.
package config package config
import ( import (
apimachineryconfig "k8s.io/apimachinery/pkg/apis/config"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
apiserverconfig "k8s.io/apiserver/pkg/apis/config" componentbaseconfig "k8s.io/component-base/config"
) )
const ( const (
@ -58,7 +57,7 @@ type KubeSchedulerConfiguration struct {
// ClientConnection specifies the kubeconfig file and client connection // ClientConnection specifies the kubeconfig file and client connection
// settings for the proxy server to use when communicating with the apiserver. // settings for the proxy server to use when communicating with the apiserver.
ClientConnection apimachineryconfig.ClientConnectionConfiguration ClientConnection componentbaseconfig.ClientConnectionConfiguration
// HealthzBindAddress is the IP address and port for the health check server to serve on, // HealthzBindAddress is the IP address and port for the health check server to serve on,
// defaulting to 0.0.0.0:10251 // defaulting to 0.0.0.0:10251
HealthzBindAddress string HealthzBindAddress string
@ -67,8 +66,8 @@ type KubeSchedulerConfiguration struct {
MetricsBindAddress string MetricsBindAddress string
// DebuggingConfiguration holds configuration for Debugging related features // DebuggingConfiguration holds configuration for Debugging related features
// TODO: We might wanna make this a substruct like Debugging apiserverconfig.DebuggingConfiguration // TODO: We might wanna make this a substruct like Debugging componentbaseconfig.DebuggingConfiguration
apiserverconfig.DebuggingConfiguration componentbaseconfig.DebuggingConfiguration
// DisablePreemption disables the pod preemption feature. // DisablePreemption disables the pod preemption feature.
DisablePreemption bool DisablePreemption bool
@ -130,7 +129,7 @@ type SchedulerPolicyConfigMapSource struct {
// KubeSchedulerLeaderElectionConfiguration expands LeaderElectionConfiguration // KubeSchedulerLeaderElectionConfiguration expands LeaderElectionConfiguration
// to include scheduler specific configuration. // to include scheduler specific configuration.
type KubeSchedulerLeaderElectionConfiguration struct { type KubeSchedulerLeaderElectionConfiguration struct {
apiserverconfig.LeaderElectionConfiguration componentbaseconfig.LeaderElectionConfiguration
// LockObjectNamespace defines the namespace of the lock object // LockObjectNamespace defines the namespace of the lock object
LockObjectNamespace string LockObjectNamespace string
// LockObjectName defines the lock object name // LockObjectName defines the lock object name

View File

@ -21,7 +21,7 @@ import (
"strconv" "strconv"
"k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime"
apiserverconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1" componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1"
kubescedulerconfigv1alpha1 "k8s.io/kube-scheduler/config/v1alpha1" kubescedulerconfigv1alpha1 "k8s.io/kube-scheduler/config/v1alpha1"
// this package shouldn't really depend on other k8s.io/kubernetes code // this package shouldn't really depend on other k8s.io/kubernetes code
@ -97,7 +97,7 @@ func SetDefaults_KubeSchedulerConfiguration(obj *kubescedulerconfigv1alpha1.Kube
} }
// Use the default LeaderElectionConfiguration options // Use the default LeaderElectionConfiguration options
apiserverconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection.LeaderElectionConfiguration) componentbaseconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection.LeaderElectionConfiguration)
if obj.BindTimeoutSeconds == nil { if obj.BindTimeoutSeconds == nil {
defaultBindTimeoutSeconds := int64(600) defaultBindTimeoutSeconds := int64(600)

View File

@ -17,17 +17,16 @@ limitations under the License.
package validation package validation
import ( import (
apimachinery "k8s.io/apimachinery/pkg/apis/config/validation"
"k8s.io/apimachinery/pkg/util/validation" "k8s.io/apimachinery/pkg/util/validation"
"k8s.io/apimachinery/pkg/util/validation/field" "k8s.io/apimachinery/pkg/util/validation/field"
apiserver "k8s.io/apiserver/pkg/apis/config/validation" componentbasevalidation "k8s.io/component-base/config/validation"
"k8s.io/kubernetes/pkg/scheduler/apis/config" "k8s.io/kubernetes/pkg/scheduler/apis/config"
) )
// ValidateKubeSchedulerConfiguration ensures validation of the KubeSchedulerConfiguration struct // ValidateKubeSchedulerConfiguration ensures validation of the KubeSchedulerConfiguration struct
func ValidateKubeSchedulerConfiguration(cc *config.KubeSchedulerConfiguration) field.ErrorList { func ValidateKubeSchedulerConfiguration(cc *config.KubeSchedulerConfiguration) field.ErrorList {
allErrs := field.ErrorList{} allErrs := field.ErrorList{}
allErrs = append(allErrs, apimachinery.ValidateClientConnectionConfiguration(&cc.ClientConnection, field.NewPath("clientConnection"))...) allErrs = append(allErrs, componentbasevalidation.ValidateClientConnectionConfiguration(&cc.ClientConnection, field.NewPath("clientConnection"))...)
allErrs = append(allErrs, ValidateKubeSchedulerLeaderElectionConfiguration(&cc.LeaderElection, field.NewPath("leaderElection"))...) allErrs = append(allErrs, ValidateKubeSchedulerLeaderElectionConfiguration(&cc.LeaderElection, field.NewPath("leaderElection"))...)
if len(cc.SchedulerName) == 0 { if len(cc.SchedulerName) == 0 {
allErrs = append(allErrs, field.Required(field.NewPath("schedulerName"), "")) allErrs = append(allErrs, field.Required(field.NewPath("schedulerName"), ""))
@ -57,7 +56,7 @@ func ValidateKubeSchedulerLeaderElectionConfiguration(cc *config.KubeSchedulerLe
if !cc.LeaderElectionConfiguration.LeaderElect { if !cc.LeaderElectionConfiguration.LeaderElect {
return allErrs return allErrs
} }
allErrs = append(allErrs, apiserver.ValidateLeaderElectionConfiguration(&cc.LeaderElectionConfiguration, field.NewPath("leaderElectionConfiguration"))...) allErrs = append(allErrs, componentbasevalidation.ValidateLeaderElectionConfiguration(&cc.LeaderElectionConfiguration, field.NewPath("leaderElectionConfiguration"))...)
if len(cc.LockObjectNamespace) == 0 { if len(cc.LockObjectNamespace) == 0 {
allErrs = append(allErrs, field.Required(fldPath.Child("lockObjectNamespace"), "")) allErrs = append(allErrs, field.Required(fldPath.Child("lockObjectNamespace"), ""))
} }

View File

@ -20,9 +20,8 @@ import (
"testing" "testing"
"time" "time"
apimachinery "k8s.io/apimachinery/pkg/apis/config"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
apiserver "k8s.io/apiserver/pkg/apis/config" componentbaseconfig "k8s.io/component-base/config"
"k8s.io/kubernetes/pkg/scheduler/apis/config" "k8s.io/kubernetes/pkg/scheduler/apis/config"
) )
@ -33,7 +32,7 @@ func TestValidateKubeSchedulerConfiguration(t *testing.T) {
HealthzBindAddress: "0.0.0.0:10254", HealthzBindAddress: "0.0.0.0:10254",
MetricsBindAddress: "0.0.0.0:10254", MetricsBindAddress: "0.0.0.0:10254",
HardPodAffinitySymmetricWeight: 80, HardPodAffinitySymmetricWeight: 80,
ClientConnection: apimachinery.ClientConnectionConfiguration{ ClientConnection: componentbaseconfig.ClientConnectionConfiguration{
AcceptContentTypes: "application/json", AcceptContentTypes: "application/json",
ContentType: "application/json", ContentType: "application/json",
QPS: 10, QPS: 10,
@ -50,7 +49,7 @@ func TestValidateKubeSchedulerConfiguration(t *testing.T) {
LeaderElection: config.KubeSchedulerLeaderElectionConfiguration{ LeaderElection: config.KubeSchedulerLeaderElectionConfiguration{
LockObjectNamespace: "name", LockObjectNamespace: "name",
LockObjectName: "name", LockObjectName: "name",
LeaderElectionConfiguration: apiserver.LeaderElectionConfiguration{ LeaderElectionConfiguration: componentbaseconfig.LeaderElectionConfiguration{
ResourceLock: "configmap", ResourceLock: "configmap",
LeaderElect: true, LeaderElect: true,
LeaseDuration: metav1.Duration{Duration: 30 * time.Second}, LeaseDuration: metav1.Duration{Duration: 30 * time.Second},

View File

@ -17,9 +17,8 @@ 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"
apiserverconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1" componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1"
) )
// PersistentVolumeRecyclerConfiguration contains elements describing persistent volume plugins. // PersistentVolumeRecyclerConfiguration contains elements describing persistent volume plugins.
@ -161,11 +160,11 @@ type GenericControllerManagerConfiguration struct {
MinResyncPeriod metav1.Duration MinResyncPeriod metav1.Duration
// ClientConnection specifies the kubeconfig file and client connection // ClientConnection specifies the kubeconfig file and client connection
// settings for the proxy server to use when communicating with the apiserver. // settings for the proxy server to use when communicating with the apiserver.
ClientConnection apimachineryconfigv1alpha1.ClientConnectionConfiguration ClientConnection componentbaseconfigv1alpha1.ClientConnectionConfiguration
// How long to wait between starting controller managers // How long to wait between starting controller managers
ControllerStartInterval metav1.Duration ControllerStartInterval metav1.Duration
// leaderElection defines the configuration of leader election client. // leaderElection defines the configuration of leader election client.
LeaderElection apiserverconfigv1alpha1.LeaderElectionConfiguration LeaderElection componentbaseconfigv1alpha1.LeaderElectionConfiguration
// Controllers is the list of controllers to enable or disable // Controllers is the list of controllers to enable or disable
// '*' means "all enabled by default controllers" // '*' means "all enabled by default controllers"
// 'foo' means "enable 'foo'" // 'foo' means "enable 'foo'"
@ -173,7 +172,7 @@ type GenericControllerManagerConfiguration struct {
// first item for a particular name wins // first item for a particular name wins
Controllers []string Controllers []string
// DebuggingConfiguration holds configuration for Debugging related features. // DebuggingConfiguration holds configuration for Debugging related features.
Debugging apiserverconfigv1alpha1.DebuggingConfiguration Debugging componentbaseconfigv1alpha1.DebuggingConfiguration
} }
// KubeCloudSharedConfiguration contains elements shared by both kube-controller manager // KubeCloudSharedConfiguration contains elements shared by both kube-controller manager

View File

@ -17,8 +17,8 @@ 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"
componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1"
) )
// KubeProxyIPTablesConfiguration contains iptables-related configuration // KubeProxyIPTablesConfiguration contains iptables-related configuration
@ -104,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 apimachineryconfigv1alpha1.ClientConnectionConfiguration `json:"clientConnection"` ClientConnection componentbaseconfigv1alpha1.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.

View File

@ -17,9 +17,8 @@ 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"
apiserverconfigv1alpha1 "k8s.io/apiserver/pkg/apis/config/v1alpha1" componentbaseconfigv1alpha1 "k8s.io/component-base/config/v1alpha1"
) )
const ( const (
@ -54,7 +53,7 @@ type KubeSchedulerConfiguration struct {
// ClientConnection specifies the kubeconfig file and client connection // ClientConnection specifies the kubeconfig file and client connection
// settings for the proxy server to use when communicating with the apiserver. // settings for the proxy server to use when communicating with the apiserver.
ClientConnection apimachineryconfigv1alpha1.ClientConnectionConfiguration `json:"clientConnection"` ClientConnection componentbaseconfigv1alpha1.ClientConnectionConfiguration `json:"clientConnection"`
// HealthzBindAddress is the IP address and port for the health check server to serve on, // HealthzBindAddress is the IP address and port for the health check server to serve on,
// defaulting to 0.0.0.0:10251 // defaulting to 0.0.0.0:10251
HealthzBindAddress string `json:"healthzBindAddress"` HealthzBindAddress string `json:"healthzBindAddress"`
@ -63,8 +62,8 @@ type KubeSchedulerConfiguration struct {
MetricsBindAddress string `json:"metricsBindAddress"` MetricsBindAddress string `json:"metricsBindAddress"`
// DebuggingConfiguration holds configuration for Debugging related features // DebuggingConfiguration holds configuration for Debugging related features
// TODO: We might wanna make this a substruct like Debugging apiserverconfig.DebuggingConfiguration // TODO: We might wanna make this a substruct like Debugging componentbaseconfigv1alpha1.DebuggingConfiguration
apiserverconfigv1alpha1.DebuggingConfiguration `json:",inline"` componentbaseconfigv1alpha1.DebuggingConfiguration `json:",inline"`
// DisablePreemption disables the pod preemption feature. // DisablePreemption disables the pod preemption feature.
DisablePreemption bool `json:"disablePreemption"` DisablePreemption bool `json:"disablePreemption"`
@ -126,7 +125,7 @@ type SchedulerPolicyConfigMapSource struct {
// KubeSchedulerLeaderElectionConfiguration expands LeaderElectionConfiguration // KubeSchedulerLeaderElectionConfiguration expands LeaderElectionConfiguration
// to include scheduler specific configuration. // to include scheduler specific configuration.
type KubeSchedulerLeaderElectionConfiguration struct { type KubeSchedulerLeaderElectionConfiguration struct {
apiserverconfigv1alpha1.LeaderElectionConfiguration `json:",inline"` componentbaseconfigv1alpha1.LeaderElectionConfiguration `json:",inline"`
// LockObjectNamespace defines the namespace of the lock object // LockObjectNamespace defines the namespace of the lock object
LockObjectNamespace string `json:"lockObjectNamespace"` LockObjectNamespace string `json:"lockObjectNamespace"`
// LockObjectName defines the lock object name // LockObjectName defines the lock object name