mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Merge pull request #102279 from mengjiao-liu/update-NewMasterConfig
Part5: master to controlplane in test/integration(1.22)
This commit is contained in:
commit
037e7f8f37
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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})
|
||||
|
@ -31,7 +31,7 @@ import (
|
||||
)
|
||||
|
||||
func TestIgnoreClusterName(t *testing.T) {
|
||||
config := framework.NewMasterConfig()
|
||||
config := framework.NewControlPlaneConfig()
|
||||
_, s, closeFn := framework.RunAMaster(config)
|
||||
defer closeFn()
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user