Part of master to controlplane in test/integration

NewMasterConfig -> NewControlPlaneConfig
This commit is contained in:
Mengjiao Liu 2021-05-25 17:58:31 +08:00
parent ae1f28d7b0
commit d3f92af74f
6 changed files with 15 additions and 15 deletions

View File

@ -31,7 +31,7 @@ import (
)
func TestAdmission(t *testing.T) {
masterConfig := framework.NewMasterConfig()
masterConfig := framework.NewControlPlaneConfig()
masterConfig.GenericConfig.EnableProfiling = true
masterConfig.GenericConfig.AdmissionControl = defaulttolerationseconds.NewDefaultTolerationSeconds()
_, s, closeFn := framework.RunAMaster(masterConfig)

View File

@ -153,7 +153,7 @@ func startApiserverOrDie(controlPlaneConfig *controlplane.Config, incomingServer
}
if controlPlaneConfig == nil {
controlPlaneConfig = NewMasterConfig()
controlPlaneConfig = NewControlPlaneConfig()
controlPlaneConfig.GenericConfig.OpenAPIConfig = DefaultOpenAPIConfig()
}
@ -256,10 +256,10 @@ func NewIntegrationTestControlPlaneConfig() *controlplane.Config {
return NewIntegrationTestControlPlaneConfigWithOptions(&MasterConfigOptions{})
}
// NewIntegrationTestControlPlaneConfigWithOptions returns the master config appropriate for most integration tests
// NewIntegrationTestControlPlaneConfigWithOptions returns the control plane config appropriate for most integration tests
// configured with the provided options.
func NewIntegrationTestControlPlaneConfigWithOptions(opts *MasterConfigOptions) *controlplane.Config {
masterConfig := NewMasterConfigWithOptions(opts)
masterConfig := NewControlPlaneConfigWithOptions(opts)
masterConfig.GenericConfig.PublicAddress = net.ParseIP("192.168.10.4")
masterConfig.ExtraConfig.APIResourceConfigSource = controlplane.DefaultAPIResourceConfigSource()
@ -284,13 +284,13 @@ func DefaultEtcdOptions() *options.EtcdOptions {
return etcdOptions
}
// NewMasterConfig returns a basic master config.
func NewMasterConfig() *controlplane.Config {
return NewMasterConfigWithOptions(&MasterConfigOptions{})
// NewControlPlaneConfig returns a basic control plane config.
func NewControlPlaneConfig() *controlplane.Config {
return NewControlPlaneConfigWithOptions(&MasterConfigOptions{})
}
// NewMasterConfigWithOptions returns a basic master config configured with the provided options.
func NewMasterConfigWithOptions(opts *MasterConfigOptions) *controlplane.Config {
// NewControlPlaneConfigWithOptions returns a basic control plane config configured with the provided options.
func NewControlPlaneConfigWithOptions(opts *MasterConfigOptions) *controlplane.Config {
etcdOptions := DefaultEtcdOptions()
if opts.EtcdOptions != nil {
etcdOptions = opts.EtcdOptions
@ -344,7 +344,7 @@ type CloseFunc func()
// RunAMaster starts a master with the provided config.
func RunAMaster(masterConfig *controlplane.Config) (*controlplane.Instance, *httptest.Server, CloseFunc) {
if masterConfig == nil {
masterConfig = NewMasterConfig()
masterConfig = NewControlPlaneConfig()
masterConfig.GenericConfig.EnableProfiling = true
}
return startApiserverOrDie(masterConfig, nil, nil)

View File

@ -94,7 +94,7 @@ func TestAppsPrefix(t *testing.T) {
}
func TestKubernetesService(t *testing.T) {
config := framework.NewMasterConfig()
config := framework.NewControlPlaneConfig()
_, _, closeFn := framework.RunAMaster(config)
defer closeFn()
coreClient := clientset.NewForConfigOrDie(config.GenericConfig.LoopbackClientConfig)

View File

@ -266,7 +266,7 @@ func TestApiserverMetricsPods(t *testing.T) {
}
}
_, server, closeFn := framework.RunAMaster(framework.NewMasterConfig())
_, server, closeFn := framework.RunAMaster(framework.NewControlPlaneConfig())
defer closeFn()
client, err := clientset.NewForConfig(&restclient.Config{Host: server.URL, QPS: -1})
@ -372,7 +372,7 @@ func TestApiserverMetricsNamespaces(t *testing.T) {
}
}
_, server, closeFn := framework.RunAMaster(framework.NewMasterConfig())
_, server, closeFn := framework.RunAMaster(framework.NewControlPlaneConfig())
defer closeFn()
client, err := clientset.NewForConfig(&restclient.Config{Host: server.URL, QPS: -1})

View File

@ -31,7 +31,7 @@ import (
)
func TestIgnoreClusterName(t *testing.T) {
config := framework.NewMasterConfig()
config := framework.NewControlPlaneConfig()
_, s, closeFn := framework.RunAMaster(config)
defer closeFn()

View File

@ -400,7 +400,7 @@ func startServiceAccountTestServer(t *testing.T) (*clientset.Clientset, restclie
serviceAccountAdmission.SetExternalKubeClientSet(externalRootClientset)
serviceAccountAdmission.SetExternalKubeInformerFactory(externalInformers)
masterConfig := framework.NewMasterConfig()
masterConfig := framework.NewControlPlaneConfig()
masterConfig.GenericConfig.EnableIndex = true
masterConfig.GenericConfig.Authentication.Authenticator = authenticator
masterConfig.GenericConfig.Authorization.Authorizer = authorizer