Merge pull request #102687 from mengjiao-liu/rename-master-to-controlplane

test/integration: Rename master to controlplane
This commit is contained in:
Kubernetes Prow Robot
2021-06-14 09:49:16 -07:00
committed by GitHub
6 changed files with 33 additions and 33 deletions

View File

@@ -59,10 +59,10 @@ import (
kubeletclient "k8s.io/kubernetes/pkg/kubelet/client"
)
// Config is a struct of configuration directives for NewMasterComponents.
// Config is a struct of configuration directives for NewControlPlaneComponents.
type Config struct {
// If nil, a default is used, partially filled configs will not get populated.
MasterConfig *controlplane.Config
InstanceConfig *controlplane.Config
StartReplicationManager bool
// Client throttling qps
QPS float32
@@ -123,7 +123,7 @@ func DefaultOpenAPIConfig() *openapicommon.Config {
return openAPIConfig
}
// startAPIServerOrDie starts a kubernetes master and an httpserver to handle api requests
// startAPIServerOrDie starts a kubernetes API server and an httpserver to handle api requests
func startAPIServerOrDie(controlPlaneConfig *controlplane.Config, incomingServer *httptest.Server, apiServerReceiver APIServerReceiver) (*controlplane.Instance, *httptest.Server, CloseFunc) {
var m *controlplane.Instance
var s *httptest.Server
@@ -210,9 +210,9 @@ func startAPIServerOrDie(controlPlaneConfig *controlplane.Config, incomingServer
m, err = controlPlaneConfig.Complete().New(genericapiserver.NewEmptyDelegate())
if err != nil {
// We log the error first so that even if closeFn crashes, the error is shown
klog.Errorf("error in bringing up the master: %v", err)
klog.Errorf("error in bringing up the apiserver: %v", err)
closeFn()
klog.Fatalf("error in bringing up the master: %v", err)
klog.Fatalf("error in bringing up the apiserver: %v", err)
}
if apiServerReceiver != nil {
apiServerReceiver.SetAPIServer(m)
@@ -251,14 +251,14 @@ func startAPIServerOrDie(controlPlaneConfig *controlplane.Config, incomingServer
return m, s, closeFn
}
// NewIntegrationTestControlPlaneConfig returns the master config appropriate for most integration tests.
// NewIntegrationTestControlPlaneConfig returns the control plane config appropriate for most integration tests.
func NewIntegrationTestControlPlaneConfig() *controlplane.Config {
return NewIntegrationTestControlPlaneConfigWithOptions(&MasterConfigOptions{})
return NewIntegrationTestControlPlaneConfigWithOptions(&ControlPlaneConfigOptions{})
}
// NewIntegrationTestControlPlaneConfigWithOptions returns the control plane config appropriate for most integration tests
// configured with the provided options.
func NewIntegrationTestControlPlaneConfigWithOptions(opts *MasterConfigOptions) *controlplane.Config {
func NewIntegrationTestControlPlaneConfigWithOptions(opts *ControlPlaneConfigOptions) *controlplane.Config {
controlPlaneConfig := NewControlPlaneConfigWithOptions(opts)
controlPlaneConfig.GenericConfig.PublicAddress = net.ParseIP("192.168.10.4")
controlPlaneConfig.ExtraConfig.APIResourceConfigSource = controlplane.DefaultAPIResourceConfigSource()
@@ -269,8 +269,8 @@ func NewIntegrationTestControlPlaneConfigWithOptions(opts *MasterConfigOptions)
return controlPlaneConfig
}
// MasterConfigOptions are the configurable options for a new integration test master config.
type MasterConfigOptions struct {
// ControlPlaneConfigOptions are the configurable options for a new integration test control plane config.
type ControlPlaneConfigOptions struct {
EtcdOptions *options.EtcdOptions
}
@@ -286,11 +286,11 @@ func DefaultEtcdOptions() *options.EtcdOptions {
// NewControlPlaneConfig returns a basic control plane config.
func NewControlPlaneConfig() *controlplane.Config {
return NewControlPlaneConfigWithOptions(&MasterConfigOptions{})
return NewControlPlaneConfigWithOptions(&ControlPlaneConfigOptions{})
}
// NewControlPlaneConfigWithOptions returns a basic control plane config configured with the provided options.
func NewControlPlaneConfigWithOptions(opts *MasterConfigOptions) *controlplane.Config {
func NewControlPlaneConfigWithOptions(opts *ControlPlaneConfigOptions) *controlplane.Config {
etcdOptions := DefaultEtcdOptions()
if opts.EtcdOptions != nil {
etcdOptions = opts.EtcdOptions
@@ -338,7 +338,7 @@ func NewControlPlaneConfigWithOptions(opts *MasterConfigOptions) *controlplane.C
}
}
// CloseFunc can be called to cleanup the master
// CloseFunc can be called to cleanup the API server
type CloseFunc func()
// RunAnAPIServer starts a API server with the provided config.