Skip to content

Commit 13b6a92

Browse files
lavalampspiffxp
authored andcommitted
It's an 'Instance' of apiserver
1 parent 2d9a0b6 commit 13b6a92

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

cmd/kube-apiserver/app/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func CreateServerChain(completedOptions completedServerRunOptions, stopCh <-chan
225225
}
226226

227227
// CreateKubeAPIServer creates and wires a workable kube-apiserver
228-
func CreateKubeAPIServer(kubeAPIServerConfig *controlplane.Config, delegateAPIServer genericapiserver.DelegationTarget) (*controlplane.Master, error) {
228+
func CreateKubeAPIServer(kubeAPIServerConfig *controlplane.Config, delegateAPIServer genericapiserver.DelegationTarget) (*controlplane.Instance, error) {
229229
kubeAPIServer, err := kubeAPIServerConfig.Complete().New(delegateAPIServer)
230230
if err != nil {
231231
return nil, err

pkg/controlplane/instance.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,8 @@ type EndpointReconcilerConfig struct {
223223
Interval time.Duration
224224
}
225225

226-
// Master contains state for a Kubernetes cluster master/api server.
227-
type Master struct {
226+
// Instance contains state for a Kubernetes cluster api server instance.
227+
type Instance struct {
228228
GenericAPIServer *genericapiserver.GenericAPIServer
229229

230230
ClusterAuthenticationInfo clusterauthenticationtrust.ClusterAuthenticationInfo
@@ -334,7 +334,7 @@ func (c *Config) Complete() CompletedConfig {
334334
// Certain config fields will be set to a default value if unset.
335335
// Certain config fields must be specified, including:
336336
// KubeletClientConfig
337-
func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget) (*Master, error) {
337+
func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget) (*Instance, error) {
338338
if reflect.DeepEqual(c.ExtraConfig.KubeletClientConfig, kubeletclient.KubeletClientConfig{}) {
339339
return nil, fmt.Errorf("Master.New() called with empty config.KubeletClientConfig")
340340
}
@@ -381,7 +381,7 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget)
381381
}
382382
}
383383

384-
m := &Master{
384+
m := &Instance{
385385
GenericAPIServer: s,
386386
ClusterAuthenticationInfo: c.ExtraConfig.ClusterAuthenticationInfo,
387387
}
@@ -486,7 +486,7 @@ func (c completedConfig) New(delegationTarget genericapiserver.DelegationTarget)
486486
}
487487

488488
// InstallLegacyAPI will install the legacy APIs for the restStorageProviders if they are enabled.
489-
func (m *Master) InstallLegacyAPI(c *completedConfig, restOptionsGetter generic.RESTOptionsGetter, legacyRESTStorageProvider corerest.LegacyRESTStorageProvider) error {
489+
func (m *Instance) InstallLegacyAPI(c *completedConfig, restOptionsGetter generic.RESTOptionsGetter, legacyRESTStorageProvider corerest.LegacyRESTStorageProvider) error {
490490
legacyRESTStorage, apiGroupInfo, err := legacyRESTStorageProvider.NewLegacyRESTStorage(restOptionsGetter)
491491
if err != nil {
492492
return fmt.Errorf("error building core storage: %v", err)
@@ -504,7 +504,7 @@ func (m *Master) InstallLegacyAPI(c *completedConfig, restOptionsGetter generic.
504504
return nil
505505
}
506506

507-
func (m *Master) installTunneler(nodeTunneler tunneler.Tunneler, nodeClient corev1client.NodeInterface) {
507+
func (m *Instance) installTunneler(nodeTunneler tunneler.Tunneler, nodeClient corev1client.NodeInterface) {
508508
nodeTunneler.Run(nodeAddressProvider{nodeClient}.externalAddresses)
509509
err := m.GenericAPIServer.AddHealthChecks(healthz.NamedCheck("SSH Tunnel Check", tunneler.TunnelSyncHealthChecker(nodeTunneler)))
510510
if err != nil {
@@ -519,7 +519,7 @@ type RESTStorageProvider interface {
519519
}
520520

521521
// InstallAPIs will install the APIs for the restStorageProviders if they are enabled.
522-
func (m *Master) InstallAPIs(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter, restStorageProviders ...RESTStorageProvider) error {
522+
func (m *Instance) InstallAPIs(apiResourceConfigSource serverstorage.APIResourceConfigSource, restOptionsGetter generic.RESTOptionsGetter, restStorageProviders ...RESTStorageProvider) error {
523523
apiGroupsInfo := []*genericapiserver.APIGroupInfo{}
524524

525525
for _, restStorageBuilder := range restStorageProviders {

test/integration/framework/master_utils.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,17 +89,17 @@ func alwaysEmpty(req *http.Request) (*authauthenticator.Response, bool, error) {
8989

9090
// MasterReceiver can be used to provide the master to a custom incoming server function
9191
type MasterReceiver interface {
92-
SetMaster(m *controlplane.Master)
92+
SetMaster(m *controlplane.Instance)
9393
}
9494

9595
// MasterHolder implements
9696
type MasterHolder struct {
9797
Initialized chan struct{}
98-
M *controlplane.Master
98+
M *controlplane.Instance
9999
}
100100

101101
// SetMaster assigns the current master.
102-
func (h *MasterHolder) SetMaster(m *controlplane.Master) {
102+
func (h *MasterHolder) SetMaster(m *controlplane.Instance) {
103103
h.M = m
104104
close(h.Initialized)
105105
}
@@ -124,8 +124,8 @@ func DefaultOpenAPIConfig() *openapicommon.Config {
124124
}
125125

126126
// startMasterOrDie starts a kubernetes master and an httpserver to handle api requests
127-
func startMasterOrDie(masterConfig *controlplane.Config, incomingServer *httptest.Server, masterReceiver MasterReceiver) (*controlplane.Master, *httptest.Server, CloseFunc) {
128-
var m *controlplane.Master
127+
func startMasterOrDie(masterConfig *controlplane.Config, incomingServer *httptest.Server, masterReceiver MasterReceiver) (*controlplane.Instance, *httptest.Server, CloseFunc) {
128+
var m *controlplane.Instance
129129
var s *httptest.Server
130130

131131
// Ensure we log at least level 4
@@ -333,7 +333,7 @@ func NewMasterConfigWithOptions(opts *MasterConfigOptions) *controlplane.Config
333333
type CloseFunc func()
334334

335335
// RunAMaster starts a master with the provided config.
336-
func RunAMaster(masterConfig *controlplane.Config) (*controlplane.Master, *httptest.Server, CloseFunc) {
336+
func RunAMaster(masterConfig *controlplane.Config) (*controlplane.Instance, *httptest.Server, CloseFunc) {
337337
if masterConfig == nil {
338338
masterConfig = NewMasterConfig()
339339
masterConfig.GenericConfig.EnableProfiling = true
@@ -342,7 +342,7 @@ func RunAMaster(masterConfig *controlplane.Config) (*controlplane.Master, *httpt
342342
}
343343

344344
// RunAMasterUsingServer starts up a master using the provided config on the specified server.
345-
func RunAMasterUsingServer(masterConfig *controlplane.Config, s *httptest.Server, masterReceiver MasterReceiver) (*controlplane.Master, *httptest.Server, CloseFunc) {
345+
func RunAMasterUsingServer(masterConfig *controlplane.Config, s *httptest.Server, masterReceiver MasterReceiver) (*controlplane.Instance, *httptest.Server, CloseFunc) {
346346
return startMasterOrDie(masterConfig, s, masterReceiver)
347347
}
348348

test/integration/openshift/openshift_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func TestMasterExportsSymbols(t *testing.T) {
3434
EnableLogsSupport: false,
3535
},
3636
}
37-
_ = &controlplane.Master{
37+
_ = &controlplane.Instance{
3838
GenericAPIServer: &genericapiserver.GenericAPIServer{},
3939
}
4040
}

0 commit comments

Comments
 (0)