From 387154f1a9af39c7cf14406fbca156bf8e978ca0 Mon Sep 17 00:00:00 2001 From: Mengjiao Liu Date: Tue, 25 May 2021 16:10:48 +0800 Subject: [PATCH] Part3: master to controlplane in test/integration Rename RunAMaster to RunAControlPlane --- .../apimachinery/watch_restart_test.go | 2 +- .../apimachinery/watch_timeout_test.go | 4 ++-- test/integration/apiserver/apiserver_test.go | 4 ++-- .../integration/apiserver/apply/apply_test.go | 6 ++--- .../apiserver/flowcontrol/concurrency_test.go | 2 +- test/integration/apiserver/watchcache_test.go | 4 ++-- test/integration/auth/accessreview_test.go | 6 ++--- test/integration/auth/auth_test.go | 22 +++++++++---------- test/integration/auth/bootstraptoken_test.go | 2 +- test/integration/auth/rbac_test.go | 8 +++---- test/integration/auth/svcaccttoken_test.go | 2 +- .../certificates/field_selector_test.go | 2 +- test/integration/configmap/configmap_test.go | 2 +- test/integration/cronjob/cronjob_test.go | 2 +- test/integration/daemonset/daemonset_test.go | 2 +- .../defaulttolerationseconds_test.go | 2 +- test/integration/deployment/util.go | 4 ++-- .../dualstack/dualstack_endpoints_test.go | 2 +- test/integration/dualstack/dualstack_test.go | 18 +++++++-------- test/integration/endpoints/endpoints_test.go | 2 +- .../endpointslicemirroring_test.go | 4 ++-- test/integration/evictions/evictions_test.go | 2 +- test/integration/framework/master_utils.go | 8 +++---- test/integration/job/job_test.go | 2 +- .../master/synthetic_master_test.go | 22 +++++++++---------- test/integration/metrics/metrics_test.go | 10 ++++----- .../namespace/ns_conditions_test.go | 2 +- .../integration/objectmeta/objectmeta_test.go | 2 +- test/integration/pods/pods_test.go | 12 +++++----- test/integration/quota/quota_test.go | 4 ++-- .../integration/replicaset/replicaset_test.go | 4 ++-- .../replicationcontroller_test.go | 2 +- test/integration/scheduler/scheduler_test.go | 4 ++-- test/integration/secrets/secrets_test.go | 2 +- test/integration/service/loadbalancer_test.go | 4 ++-- .../serviceaccount/service_account_test.go | 2 +- test/integration/statefulset/util.go | 2 +- .../storageclasses/storage_classes_test.go | 2 +- .../ttlcontroller/ttlcontroller_test.go | 2 +- test/integration/util/util.go | 4 ++-- test/integration/volume/attach_detach_test.go | 10 ++++----- .../volume/persistent_volumes_test.go | 20 ++++++++--------- test/integration/volumescheduling/util.go | 2 +- 43 files changed, 113 insertions(+), 113 deletions(-) diff --git a/test/integration/apimachinery/watch_restart_test.go b/test/integration/apimachinery/watch_restart_test.go index 944177e8d11..5b922c430b6 100644 --- a/test/integration/apimachinery/watch_restart_test.go +++ b/test/integration/apimachinery/watch_restart_test.go @@ -70,7 +70,7 @@ func TestWatchRestartsIfTimeoutNotReached(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() // Timeout is set random between MinRequestTimeout and 2x masterConfig.GenericConfig.MinRequestTimeout = int(timeout.Seconds()) / 4 - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() config := &restclient.Config{ diff --git a/test/integration/apimachinery/watch_timeout_test.go b/test/integration/apimachinery/watch_timeout_test.go index 801f6493543..5ff1d68e5bd 100644 --- a/test/integration/apimachinery/watch_timeout_test.go +++ b/test/integration/apimachinery/watch_timeout_test.go @@ -44,7 +44,7 @@ import ( func TestWebsocketWatchClientTimeout(t *testing.T) { // server setup masterConfig := framework.NewIntegrationTestControlPlaneConfig() - instance, s, closeFn := framework.RunAMaster(masterConfig) + instance, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() // object setup @@ -144,7 +144,7 @@ func TestWebsocketWatchClientTimeout(t *testing.T) { func TestWatchClientTimeout(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() t.Run("direct", func(t *testing.T) { diff --git a/test/integration/apiserver/apiserver_test.go b/test/integration/apiserver/apiserver_test.go index 676a774b321..c6c3506eaf9 100644 --- a/test/integration/apiserver/apiserver_test.go +++ b/test/integration/apiserver/apiserver_test.go @@ -92,7 +92,7 @@ func setupWithResourcesWithOptions(t *testing.T, opts *framework.MasterConfigOpt masterConfig.ExtraConfig.APIResourceConfigSource = resourceConfig } masterConfig.GenericConfig.OpenAPIConfig = framework.DefaultOpenAPIConfig() - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) clientSet, err := clientset.NewForConfig(&restclient.Config{Host: s.URL, QPS: -1}) if err != nil { @@ -226,7 +226,7 @@ func Test4xxStatusCodeInvalidPatch(t *testing.T) { func TestCacheControl(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfigWithOptions(&framework.MasterConfigOptions{}) masterConfig.GenericConfig.OpenAPIConfig = framework.DefaultOpenAPIConfig() - master, _, closeFn := framework.RunAMaster(masterConfig) + master, _, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() rt, err := restclient.TransportFor(master.GenericAPIServer.LoopbackClientConfig) diff --git a/test/integration/apiserver/apply/apply_test.go b/test/integration/apiserver/apply/apply_test.go index c0bc5aa2131..4bb0d7cdcbf 100644 --- a/test/integration/apiserver/apply/apply_test.go +++ b/test/integration/apiserver/apply/apply_test.go @@ -59,7 +59,7 @@ func setup(t testing.TB, groupVersions ...schema.GroupVersion) (*httptest.Server masterConfig.ExtraConfig.APIResourceConfigSource = resourceConfig } masterConfig.GenericConfig.OpenAPIConfig = framework.DefaultOpenAPIConfig() - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) clientSet, err := clientset.NewForConfig(&restclient.Config{Host: s.URL, QPS: -1}) if err != nil { @@ -2825,7 +2825,7 @@ func TestStopTrackingManagedFieldsOnFeatureDisabled(t *testing.T) { masterConfig.GenericConfig.OpenAPIConfig = framework.DefaultOpenAPIConfig() defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, genericfeatures.ServerSideApply, true)() - _, master, closeFn := framework.RunAMaster(masterConfig) + _, master, closeFn := framework.RunAnAPIServer(masterConfig) client, err := clientset.NewForConfig(&restclient.Config{Host: master.URL, QPS: -1}) if err != nil { t.Fatalf("Error in create clientset: %v", err) @@ -2878,7 +2878,7 @@ spec: // Restart server with server-side apply disabled closeFn() defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, genericfeatures.ServerSideApply, false)() - _, master, closeFn = framework.RunAMaster(masterConfig) + _, master, closeFn = framework.RunAnAPIServer(masterConfig) client, err = clientset.NewForConfig(&restclient.Config{Host: master.URL, QPS: -1}) if err != nil { t.Fatalf("Error in create clientset: %v", err) diff --git a/test/integration/apiserver/flowcontrol/concurrency_test.go b/test/integration/apiserver/flowcontrol/concurrency_test.go index 4e5c1213c2f..70bf5300cf9 100644 --- a/test/integration/apiserver/flowcontrol/concurrency_test.go +++ b/test/integration/apiserver/flowcontrol/concurrency_test.go @@ -62,7 +62,7 @@ func setup(t testing.TB, maxReadonlyRequestsInFlight, MaxMutatingRequestsInFligh masterConfig.GenericConfig.MaxMutatingRequestsInFlight = MaxMutatingRequestsInFlight masterConfig.GenericConfig.OpenAPIConfig = framework.DefaultOpenAPIConfig() masterConfig.ExtraConfig.APIResourceConfigSource = resourceConfig - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) return s, masterConfig.GenericConfig.LoopbackClientConfig, closeFn } diff --git a/test/integration/apiserver/watchcache_test.go b/test/integration/apiserver/watchcache_test.go index bf31ae45df7..e8452dfd873 100644 --- a/test/integration/apiserver/watchcache_test.go +++ b/test/integration/apiserver/watchcache_test.go @@ -58,7 +58,7 @@ func multiEtcdSetup(t testing.TB) (clientset.Interface, framework.CloseFunc) { masterConfig := framework.NewIntegrationTestControlPlaneConfigWithOptions(&opts) // Switch off endpoints reconciler to avoid unnecessary operations. masterConfig.ExtraConfig.EndpointReconcilerType = reconcilers.NoneEndpointReconcilerType - _, s, stopMaster := framework.RunAMaster(masterConfig) + _, s, stopMaster := framework.RunAnAPIServer(masterConfig) closeFn := func() { stopMaster() @@ -72,7 +72,7 @@ func multiEtcdSetup(t testing.TB) (clientset.Interface, framework.CloseFunc) { } // Wait for apiserver to be stabilized. - // Everything but default service creation is checked in RunAMaster above by + // Everything but default service creation is checked in RunAnAPIServer above by // waiting for post start hooks, so we just wait for default service to exist. // TODO(wojtek-t): Figure out less fragile way. ctx := context.Background() diff --git a/test/integration/auth/accessreview_test.go b/test/integration/auth/accessreview_test.go index 837bcffc117..71c9ea93467 100644 --- a/test/integration/auth/accessreview_test.go +++ b/test/integration/auth/accessreview_test.go @@ -58,7 +58,7 @@ func TestSubjectAccessReview(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = authenticator.RequestFunc(alwaysAlice) masterConfig.GenericConfig.Authorization.Authorizer = sarAuthorizer{} - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() clientset := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) @@ -153,7 +153,7 @@ func TestSelfSubjectAccessReview(t *testing.T) { }, true, nil }) masterConfig.GenericConfig.Authorization.Authorizer = sarAuthorizer{} - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() clientset := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) @@ -232,7 +232,7 @@ func TestLocalSubjectAccessReview(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = authenticator.RequestFunc(alwaysAlice) masterConfig.GenericConfig.Authorization.Authorizer = sarAuthorizer{} - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() clientset := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) diff --git a/test/integration/auth/auth_test.go b/test/integration/auth/auth_test.go index ec2c9cb0e75..da0e209131a 100644 --- a/test/integration/auth/auth_test.go +++ b/test/integration/auth/auth_test.go @@ -441,7 +441,7 @@ func getTestRequests(namespace string) []struct { func TestAuthModeAlwaysAllow(t *testing.T) { // Set up a master masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() ns := framework.CreateTestingNamespace("auth-always-allow", s, t) @@ -539,7 +539,7 @@ func TestAuthModeAlwaysDeny(t *testing.T) { // Set up a master masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authorization.Authorizer = authorizerfactory.NewAlwaysDenyAuthorizer() - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() ns := framework.CreateTestingNamespace("auth-always-deny", s, t) @@ -589,7 +589,7 @@ func TestAliceNotForbiddenOrUnauthorized(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = allowAliceAuthorizer{} - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() ns := framework.CreateTestingNamespace("auth-alice-not-forbidden", s, t) @@ -658,7 +658,7 @@ func TestBobIsForbidden(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = allowAliceAuthorizer{} - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() ns := framework.CreateTestingNamespace("auth-bob-forbidden", s, t) @@ -702,7 +702,7 @@ func TestUnknownUserIsUnauthorized(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = allowAliceAuthorizer{} - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() ns := framework.CreateTestingNamespace("auth-unknown-unauthorized", s, t) @@ -764,7 +764,7 @@ func TestImpersonateIsForbidden(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = impersonateAuthorizer{} - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() ns := framework.CreateTestingNamespace("auth-impersonate-forbidden", s, t) @@ -911,7 +911,7 @@ func TestAuthorizationAttributeDetermination(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = trackingAuthorizer - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() ns := framework.CreateTestingNamespace("auth-attribute-determination", s, t) @@ -977,7 +977,7 @@ func TestNamespaceAuthorization(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = a - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() ns := framework.CreateTestingNamespace("auth-namespace", s, t) @@ -1075,7 +1075,7 @@ func TestKindAuthorization(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = a - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() ns := framework.CreateTestingNamespace("auth-kind", s, t) @@ -1159,7 +1159,7 @@ func TestReadOnlyAuthorization(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = a - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() ns := framework.CreateTestingNamespace("auth-read-only", s, t) @@ -1236,7 +1236,7 @@ func testWebhookTokenAuthenticator(customDialer bool, t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = authenticator masterConfig.GenericConfig.Authorization.Authorizer = allowAliceAuthorizer{} - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() ns := framework.CreateTestingNamespace("auth-webhook-token", s, t) diff --git a/test/integration/auth/bootstraptoken_test.go b/test/integration/auth/bootstraptoken_test.go index 21973337fab..0c58854c40a 100644 --- a/test/integration/auth/bootstraptoken_test.go +++ b/test/integration/auth/bootstraptoken_test.go @@ -119,7 +119,7 @@ func TestBootstrapTokenAuth(t *testing.T) { // Set up a master masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = authenticator - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() ns := framework.CreateTestingNamespace("auth-bootstrap-token", s, t) diff --git a/test/integration/auth/rbac_test.go b/test/integration/auth/rbac_test.go index 3347e162364..4c97ac2cc61 100644 --- a/test/integration/auth/rbac_test.go +++ b/test/integration/auth/rbac_test.go @@ -535,7 +535,7 @@ func TestRBAC(t *testing.T) { "user-with-no-permissions": {Name: "user-with-no-permissions"}, })) masterConfig.GenericConfig.OpenAPIConfig = framework.DefaultOpenAPIConfig() - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() clientConfig := &restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{NegotiatedSerializer: legacyscheme.Codecs}} @@ -647,7 +647,7 @@ func TestBootstrapping(t *testing.T) { masterConfig.GenericConfig.Authentication.Authenticator = bearertoken.New(tokenfile.New(map[string]*user.DefaultInfo{ superUser: {Name: "admin", Groups: []string{"system:masters"}}, })) - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() clientset := clientset.NewForConfigOrDie(&restclient.Config{BearerToken: superUser, Host: s.URL}) @@ -708,7 +708,7 @@ func TestDiscoveryUpgradeBootstrapping(t *testing.T) { masterConfig.GenericConfig.Authentication.Authenticator = bearertoken.New(tokenfile.New(map[string]*user.DefaultInfo{ superUser: {Name: "admin", Groups: []string{"system:masters"}}, })) - _, s, tearDownFn := framework.RunAMaster(masterConfig) + _, s, tearDownFn := framework.RunAnAPIServer(masterConfig) client := clientset.NewForConfigOrDie(&restclient.Config{BearerToken: superUser, Host: s.URL}) @@ -752,7 +752,7 @@ func TestDiscoveryUpgradeBootstrapping(t *testing.T) { // Check that upgraded API servers inherit `system:public-info-viewer` settings from // `system:discovery`, and respect auto-reconciliation annotations. - _, s, tearDownFn = framework.RunAMaster(masterConfig) + _, s, tearDownFn = framework.RunAnAPIServer(masterConfig) client = clientset.NewForConfigOrDie(&restclient.Config{BearerToken: superUser, Host: s.URL}) diff --git a/test/integration/auth/svcaccttoken_test.go b/test/integration/auth/svcaccttoken_test.go index 8f90c289014..13ae39c83bd 100644 --- a/test/integration/auth/svcaccttoken_test.go +++ b/test/integration/auth/svcaccttoken_test.go @@ -119,7 +119,7 @@ func TestServiceAccountTokenCreate(t *testing.T) { masterConfig.ExtraConfig.ServiceAccountJWKSURI = "" masterConfig.ExtraConfig.ServiceAccountPublicKeys = []interface{}{&pk} - master, _, closeFn := framework.RunAMaster(masterConfig) + master, _, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() cs, err := clientset.NewForConfig(master.GenericAPIServer.LoopbackClientConfig) diff --git a/test/integration/certificates/field_selector_test.go b/test/integration/certificates/field_selector_test.go index 6209f05b861..70194b75def 100644 --- a/test/integration/certificates/field_selector_test.go +++ b/test/integration/certificates/field_selector_test.go @@ -37,7 +37,7 @@ import ( // Verifies that the 'spec.signerName' field can be correctly used as a field selector on LIST requests func TestCSRSignerNameFieldSelector(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: &schema.GroupVersion{Group: "", Version: "v1"}}}) diff --git a/test/integration/configmap/configmap_test.go b/test/integration/configmap/configmap_test.go index 6620db7e630..3052473136b 100644 --- a/test/integration/configmap/configmap_test.go +++ b/test/integration/configmap/configmap_test.go @@ -33,7 +33,7 @@ import ( // TestConfigMap tests apiserver-side behavior of creation of ConfigMaps and pods that consume them. func TestConfigMap(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: &schema.GroupVersion{Group: "", Version: "v1"}}}) diff --git a/test/integration/cronjob/cronjob_test.go b/test/integration/cronjob/cronjob_test.go index aed05d72901..4d44ef5fdeb 100644 --- a/test/integration/cronjob/cronjob_test.go +++ b/test/integration/cronjob/cronjob_test.go @@ -39,7 +39,7 @@ import ( func setup(t *testing.T) (*httptest.Server, framework.CloseFunc, *cronjob.Controller, *job.Controller, informers.SharedInformerFactory, clientset.Interface, restclient.Config) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, server, closeFn := framework.RunAMaster(masterConfig) + _, server, closeFn := framework.RunAnAPIServer(masterConfig) config := restclient.Config{Host: server.URL} clientSet, err := clientset.NewForConfig(&config) diff --git a/test/integration/daemonset/daemonset_test.go b/test/integration/daemonset/daemonset_test.go index c4d27c098ce..5e2d0a369a9 100644 --- a/test/integration/daemonset/daemonset_test.go +++ b/test/integration/daemonset/daemonset_test.go @@ -53,7 +53,7 @@ var zero = int64(0) func setup(t *testing.T) (*httptest.Server, framework.CloseFunc, *daemon.DaemonSetsController, informers.SharedInformerFactory, clientset.Interface) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, server, closeFn := framework.RunAMaster(masterConfig) + _, server, closeFn := framework.RunAnAPIServer(masterConfig) config := restclient.Config{Host: server.URL} clientSet, err := clientset.NewForConfig(&config) diff --git a/test/integration/defaulttolerationseconds/defaulttolerationseconds_test.go b/test/integration/defaulttolerationseconds/defaulttolerationseconds_test.go index 1bfa4d89560..b7de2e31d28 100644 --- a/test/integration/defaulttolerationseconds/defaulttolerationseconds_test.go +++ b/test/integration/defaulttolerationseconds/defaulttolerationseconds_test.go @@ -34,7 +34,7 @@ func TestAdmission(t *testing.T) { masterConfig := framework.NewControlPlaneConfig() masterConfig.GenericConfig.EnableProfiling = true masterConfig.GenericConfig.AdmissionControl = defaulttolerationseconds.NewDefaultTolerationSeconds() - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: &schema.GroupVersion{Group: "", Version: "v1"}}}) diff --git a/test/integration/deployment/util.go b/test/integration/deployment/util.go index 3c17bcee313..6a40f4d93d4 100644 --- a/test/integration/deployment/util.go +++ b/test/integration/deployment/util.go @@ -104,7 +104,7 @@ func newDeployment(name, ns string, replicas int32) *apps.Deployment { // dcSetup sets up necessities for Deployment integration test, including master, apiserver, informers, and clientset func dcSetup(t *testing.T) (*httptest.Server, framework.CloseFunc, *replicaset.ReplicaSetController, *deployment.DeploymentController, informers.SharedInformerFactory, clientset.Interface) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) config := restclient.Config{Host: s.URL} clientSet, err := clientset.NewForConfig(&config) @@ -136,7 +136,7 @@ func dcSetup(t *testing.T) (*httptest.Server, framework.CloseFunc, *replicaset.R // and clientset, but not controllers and informers func dcSimpleSetup(t *testing.T) (*httptest.Server, framework.CloseFunc, clientset.Interface) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) config := restclient.Config{Host: s.URL} clientSet, err := clientset.NewForConfig(&config) diff --git a/test/integration/dualstack/dualstack_endpoints_test.go b/test/integration/dualstack/dualstack_endpoints_test.go index ca7f8f0448f..e71b280bb24 100644 --- a/test/integration/dualstack/dualstack_endpoints_test.go +++ b/test/integration/dualstack/dualstack_endpoints_test.go @@ -64,7 +64,7 @@ func TestDualStackEndpoints(t *testing.T) { } cfg.ExtraConfig.SecondaryServiceIPRange = *secCidr - _, s, closeFn := framework.RunAMaster(cfg) + _, s, closeFn := framework.RunAnAPIServer(cfg) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) diff --git a/test/integration/dualstack/dualstack_test.go b/test/integration/dualstack/dualstack_test.go index 584a8fe51c8..eeeba0219e6 100644 --- a/test/integration/dualstack/dualstack_test.go +++ b/test/integration/dualstack/dualstack_test.go @@ -59,7 +59,7 @@ func TestCreateServiceSingleStackIPv4(t *testing.T) { t.Fatalf("bad cidr: %v", err) } cfg.ExtraConfig.ServiceIPRange = *cidr - _, s, closeFn := framework.RunAMaster(cfg) + _, s, closeFn := framework.RunAnAPIServer(cfg) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) @@ -276,7 +276,7 @@ func TestCreateServiceDualStackIPv6(t *testing.T) { t.Fatalf("bad cidr: %v", err) } cfg.ExtraConfig.ServiceIPRange = *cidr - _, s, closeFn := framework.RunAMaster(cfg) + _, s, closeFn := framework.RunAnAPIServer(cfg) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) @@ -503,7 +503,7 @@ func TestCreateServiceDualStackIPv4IPv6(t *testing.T) { } cfg.ExtraConfig.SecondaryServiceIPRange = *secCidr - _, s, closeFn := framework.RunAMaster(cfg) + _, s, closeFn := framework.RunAnAPIServer(cfg) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) @@ -730,7 +730,7 @@ func TestCreateServiceDualStackIPv6IPv4(t *testing.T) { } cfg.ExtraConfig.SecondaryServiceIPRange = *secCidr - _, s, closeFn := framework.RunAMaster(cfg) + _, s, closeFn := framework.RunAnAPIServer(cfg) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) @@ -960,7 +960,7 @@ func TestUpgradeDowngrade(t *testing.T) { } cfg.ExtraConfig.SecondaryServiceIPRange = *secCidr - _, s, closeFn := framework.RunAMaster(cfg) + _, s, closeFn := framework.RunAnAPIServer(cfg) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) @@ -1075,7 +1075,7 @@ func TestConvertToFromExternalName(t *testing.T) { } cfg.ExtraConfig.SecondaryServiceIPRange = *secCidr - _, s, closeFn := framework.RunAMaster(cfg) + _, s, closeFn := framework.RunAnAPIServer(cfg) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) @@ -1159,7 +1159,7 @@ func TestExistingServiceDefaulting(t *testing.T) { } cfg.ExtraConfig.ServiceIPRange = *cidr - _, s, closeFn := framework.RunAMaster(cfg) + _, s, closeFn := framework.RunAnAPIServer(cfg) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) @@ -1248,7 +1248,7 @@ func TestPreferDualStack(t *testing.T) { } cfg.ExtraConfig.SecondaryServiceIPRange = *secCidr - _, s, closeFn := framework.RunAMaster(cfg) + _, s, closeFn := framework.RunAnAPIServer(cfg) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) @@ -1326,7 +1326,7 @@ func TestServiceUpdate(t *testing.T) { t.Fatalf("bad cidr: %v", err) } cfg.ExtraConfig.ServiceIPRange = *cidr - _, s, closeFn := framework.RunAMaster(cfg) + _, s, closeFn := framework.RunAnAPIServer(cfg) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) diff --git a/test/integration/endpoints/endpoints_test.go b/test/integration/endpoints/endpoints_test.go index 054da964ff6..7cd95601c2a 100644 --- a/test/integration/endpoints/endpoints_test.go +++ b/test/integration/endpoints/endpoints_test.go @@ -34,7 +34,7 @@ import ( func TestEndpointUpdates(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, server, closeFn := framework.RunAMaster(masterConfig) + _, server, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() config := restclient.Config{Host: server.URL} diff --git a/test/integration/endpointslice/endpointslicemirroring_test.go b/test/integration/endpointslice/endpointslicemirroring_test.go index c9dc13a2092..e3300ed860d 100644 --- a/test/integration/endpointslice/endpointslicemirroring_test.go +++ b/test/integration/endpointslice/endpointslicemirroring_test.go @@ -40,7 +40,7 @@ import ( func TestEndpointSliceMirroring(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, server, closeFn := framework.RunAMaster(masterConfig) + _, server, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() config := restclient.Config{Host: server.URL} @@ -234,7 +234,7 @@ func TestEndpointSliceMirroring(t *testing.T) { func TestEndpointSliceMirroringUpdates(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, server, closeFn := framework.RunAMaster(masterConfig) + _, server, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() config := restclient.Config{Host: server.URL} diff --git a/test/integration/evictions/evictions_test.go b/test/integration/evictions/evictions_test.go index 4c50a88641c..6d5f2fb56d6 100644 --- a/test/integration/evictions/evictions_test.go +++ b/test/integration/evictions/evictions_test.go @@ -422,7 +422,7 @@ func newV1Eviction(ns, evictionName string, deleteOption metav1.DeleteOptions) * func rmSetup(t *testing.T) (*httptest.Server, framework.CloseFunc, *disruption.DisruptionController, informers.SharedInformerFactory, clientset.Interface) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) config := restclient.Config{Host: s.URL} clientSet, err := clientset.NewForConfig(&config) diff --git a/test/integration/framework/master_utils.go b/test/integration/framework/master_utils.go index 552c84d8c4e..194b2f8455c 100644 --- a/test/integration/framework/master_utils.go +++ b/test/integration/framework/master_utils.go @@ -341,8 +341,8 @@ func NewControlPlaneConfigWithOptions(opts *MasterConfigOptions) *controlplane.C // CloseFunc can be called to cleanup the master type CloseFunc func() -// RunAMaster starts a master with the provided config. -func RunAMaster(masterConfig *controlplane.Config) (*controlplane.Instance, *httptest.Server, CloseFunc) { +// RunAnAPIServer starts a API server with the provided config. +func RunAnAPIServer(masterConfig *controlplane.Config) (*controlplane.Instance, *httptest.Server, CloseFunc) { if masterConfig == nil { masterConfig = NewControlPlaneConfig() masterConfig.GenericConfig.EnableProfiling = true @@ -350,8 +350,8 @@ func RunAMaster(masterConfig *controlplane.Config) (*controlplane.Instance, *htt return startApiserverOrDie(masterConfig, nil, nil) } -// RunAnApiserverUsingServer starts up an instance using the provided config on the specified server. -func RunAnApiserverUsingServer(controlPlaneConfig *controlplane.Config, s *httptest.Server, masterReceiver MasterReceiver) (*controlplane.Instance, *httptest.Server, CloseFunc) { +// RunAnAPIServerUsingServer starts up an instance using the provided config on the specified server. +func RunAnAPIServerUsingServer(controlPlaneConfig *controlplane.Config, s *httptest.Server, masterReceiver MasterReceiver) (*controlplane.Instance, *httptest.Server, CloseFunc) { return startApiserverOrDie(controlPlaneConfig, s, masterReceiver) } diff --git a/test/integration/job/job_test.go b/test/integration/job/job_test.go index fdcba899593..057c9ef6e76 100644 --- a/test/integration/job/job_test.go +++ b/test/integration/job/job_test.go @@ -608,7 +608,7 @@ func createJobWithDefaults(ctx context.Context, clientSet clientset.Interface, n func setup(t *testing.T, nsBaseName string) (framework.CloseFunc, *restclient.Config, clientset.Interface, *v1.Namespace) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, server, masterCloseFn := framework.RunAMaster(masterConfig) + _, server, masterCloseFn := framework.RunAnAPIServer(masterConfig) config := restclient.Config{Host: server.URL} clientSet, err := clientset.NewForConfig(&config) diff --git a/test/integration/master/synthetic_master_test.go b/test/integration/master/synthetic_master_test.go index 5004b8a8695..745ccb45c91 100644 --- a/test/integration/master/synthetic_master_test.go +++ b/test/integration/master/synthetic_master_test.go @@ -69,7 +69,7 @@ func (allowAliceAuthorizer) Authorize(ctx context.Context, a authorizer.Attribut } func testPrefix(t *testing.T, prefix string) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() resp, err := http.Get(s.URL + prefix) @@ -95,7 +95,7 @@ func TestAppsPrefix(t *testing.T) { func TestKubernetesService(t *testing.T) { config := framework.NewControlPlaneConfig() - _, _, closeFn := framework.RunAMaster(config) + _, _, closeFn := framework.RunAnAPIServer(config) defer closeFn() coreClient := clientset.NewForConfigOrDie(config.GenericConfig.LoopbackClientConfig) err := wait.PollImmediate(time.Millisecond*100, wait.ForeverTestTimeout, func() (bool, error) { @@ -112,7 +112,7 @@ func TestKubernetesService(t *testing.T) { } func TestEmptyList(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() u := s.URL + "/api/v1/namespaces/default/pods" @@ -191,7 +191,7 @@ func TestStatus(t *testing.T) { } for _, tc := range testCases { - _, s, closeFn := framework.RunAMaster(tc.masterConfig) + _, s, closeFn := framework.RunAnAPIServer(tc.masterConfig) defer closeFn() u := s.URL + tc.reqPath @@ -298,7 +298,7 @@ func constructBody(val string, size int, field string, t *testing.T) *appsv1.Dep } func TestObjectSizeResponses(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) @@ -349,7 +349,7 @@ func TestObjectSizeResponses(t *testing.T) { } func TestWatchSucceedsWithoutArgs(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() resp, err := http.Get(s.URL + "/api/v1/namespaces?watch=1") @@ -430,7 +430,7 @@ func appsPath(resource, namespace, name string) string { } func TestAutoscalingGroupBackwardCompatibility(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() transport := http.DefaultTransport @@ -475,7 +475,7 @@ func TestAutoscalingGroupBackwardCompatibility(t *testing.T) { } func TestAppsGroupBackwardCompatibility(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() transport := http.DefaultTransport @@ -523,7 +523,7 @@ func TestAppsGroupBackwardCompatibility(t *testing.T) { } func TestAccept(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() resp, err := http.Get(s.URL + "/api/") @@ -601,7 +601,7 @@ func countEndpoints(eps *corev1.Endpoints) int { } func TestMasterService(t *testing.T) { - _, s, closeFn := framework.RunAMaster(framework.NewIntegrationTestControlPlaneConfig()) + _, s, closeFn := framework.RunAnAPIServer(framework.NewIntegrationTestControlPlaneConfig()) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) @@ -643,7 +643,7 @@ func TestServiceAlloc(t *testing.T) { t.Fatalf("bad cidr: %v", err) } cfg.ExtraConfig.ServiceIPRange = *cidr - _, s, closeFn := framework.RunAMaster(cfg) + _, s, closeFn := framework.RunAnAPIServer(cfg) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) diff --git a/test/integration/metrics/metrics_test.go b/test/integration/metrics/metrics_test.go index 8731140d379..6f94e431ef7 100644 --- a/test/integration/metrics/metrics_test.go +++ b/test/integration/metrics/metrics_test.go @@ -72,7 +72,7 @@ func TestMasterProcessMetrics(t *testing.T) { t.Skipf("not supported on GOOS=%s", runtime.GOOS) } - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() metrics, err := scrapeMetrics(s) @@ -88,7 +88,7 @@ func TestMasterProcessMetrics(t *testing.T) { } func TestApiserverMetrics(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() // Make a request to the apiserver to ensure there's at least one data point @@ -116,7 +116,7 @@ func TestApiserverMetrics(t *testing.T) { } func TestApiserverMetricsLabels(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() client, err := clientset.NewForConfig(&restclient.Config{Host: s.URL, QPS: -1}) @@ -266,7 +266,7 @@ func TestApiserverMetricsPods(t *testing.T) { } } - _, server, closeFn := framework.RunAMaster(framework.NewControlPlaneConfig()) + _, server, closeFn := framework.RunAnAPIServer(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.NewControlPlaneConfig()) + _, server, closeFn := framework.RunAnAPIServer(framework.NewControlPlaneConfig()) defer closeFn() client, err := clientset.NewForConfig(&restclient.Config{Host: server.URL, QPS: -1}) diff --git a/test/integration/namespace/ns_conditions_test.go b/test/integration/namespace/ns_conditions_test.go index e6915172533..3f5b3ef1d02 100644 --- a/test/integration/namespace/ns_conditions_test.go +++ b/test/integration/namespace/ns_conditions_test.go @@ -166,7 +166,7 @@ func jsonToUnstructured(stub, version, kind string) (*unstructured.Unstructured, func namespaceLifecycleSetup(t *testing.T) (framework.CloseFunc, *namespace.NamespaceController, informers.SharedInformerFactory, clientset.Interface, dynamic.Interface) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) config := restclient.Config{Host: s.URL} config.QPS = 10000 diff --git a/test/integration/objectmeta/objectmeta_test.go b/test/integration/objectmeta/objectmeta_test.go index ce78555fb55..f2be620bc8a 100644 --- a/test/integration/objectmeta/objectmeta_test.go +++ b/test/integration/objectmeta/objectmeta_test.go @@ -32,7 +32,7 @@ import ( func TestIgnoreClusterName(t *testing.T) { config := framework.NewControlPlaneConfig() - _, s, closeFn := framework.RunAMaster(config) + _, s, closeFn := framework.RunAnAPIServer(config) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: &schema.GroupVersion{Group: "", Version: "v1"}}}) diff --git a/test/integration/pods/pods_test.go b/test/integration/pods/pods_test.go index 404994cde90..376bd6ebb61 100644 --- a/test/integration/pods/pods_test.go +++ b/test/integration/pods/pods_test.go @@ -38,7 +38,7 @@ import ( ) func TestPodUpdateActiveDeadlineSeconds(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("pod-activedeadline-update", s, t) @@ -155,7 +155,7 @@ func TestPodUpdateActiveDeadlineSeconds(t *testing.T) { } func TestPodReadOnlyFilesystem(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() isReadOnly := true @@ -191,7 +191,7 @@ func TestPodReadOnlyFilesystem(t *testing.T) { func TestPodCreateEphemeralContainers(t *testing.T) { defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.EphemeralContainers, true)() - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("pod-create-ephemeral-containers", s, t) @@ -261,7 +261,7 @@ func setUpEphemeralContainers(podsClient typedv1.PodInterface, pod *v1.Pod, cont func TestPodPatchEphemeralContainers(t *testing.T) { defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.EphemeralContainers, true)() - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("pod-patch-ephemeral-containers", s, t) @@ -493,7 +493,7 @@ func TestPodPatchEphemeralContainers(t *testing.T) { func TestPodUpdateEphemeralContainers(t *testing.T) { defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.EphemeralContainers, true)() - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("pod-update-ephemeral-containers", s, t) @@ -686,7 +686,7 @@ func TestPodUpdateEphemeralContainers(t *testing.T) { func TestPodEphemeralContainersDisabled(t *testing.T) { defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.EphemeralContainers, false)() - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("pod-ephemeral-containers-disabled", s, t) diff --git a/test/integration/quota/quota_test.go b/test/integration/quota/quota_test.go index 01a3c58d09c..3ca33a7c79d 100644 --- a/test/integration/quota/quota_test.go +++ b/test/integration/quota/quota_test.go @@ -77,7 +77,7 @@ func TestQuota(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.AdmissionControl = admission - _, _, closeFn := framework.RunAnApiserverUsingServer(masterConfig, s, h) + _, _, closeFn := framework.RunAnAPIServerUsingServer(masterConfig, s, h) defer closeFn() ns := framework.CreateTestingNamespace("quotaed", s, t) @@ -277,7 +277,7 @@ func TestQuotaLimitedResourceDenial(t *testing.T) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.AdmissionControl = admission - _, _, closeFn := framework.RunAnApiserverUsingServer(masterConfig, s, h) + _, _, closeFn := framework.RunAnAPIServerUsingServer(masterConfig, s, h) defer closeFn() ns := framework.CreateTestingNamespace("quota", s, t) diff --git a/test/integration/replicaset/replicaset_test.go b/test/integration/replicaset/replicaset_test.go index fa744269f6f..f4dd8be5823 100644 --- a/test/integration/replicaset/replicaset_test.go +++ b/test/integration/replicaset/replicaset_test.go @@ -119,7 +119,7 @@ func newMatchingPod(podName, namespace string) *v1.Pod { func rmSetup(t *testing.T) (*httptest.Server, framework.CloseFunc, *replicaset.ReplicaSetController, informers.SharedInformerFactory, clientset.Interface) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) config := restclient.Config{Host: s.URL} clientSet, err := clientset.NewForConfig(&config) @@ -141,7 +141,7 @@ func rmSetup(t *testing.T) (*httptest.Server, framework.CloseFunc, *replicaset.R func rmSimpleSetup(t *testing.T) (*httptest.Server, framework.CloseFunc, clientset.Interface) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) config := restclient.Config{Host: s.URL} clientSet, err := clientset.NewForConfig(&config) diff --git a/test/integration/replicationcontroller/replicationcontroller_test.go b/test/integration/replicationcontroller/replicationcontroller_test.go index 502dbcf8b55..b789fc423d4 100644 --- a/test/integration/replicationcontroller/replicationcontroller_test.go +++ b/test/integration/replicationcontroller/replicationcontroller_test.go @@ -112,7 +112,7 @@ func newMatchingPod(podName, namespace string) *v1.Pod { func rmSetup(t *testing.T) (*httptest.Server, framework.CloseFunc, *replication.ReplicationManager, informers.SharedInformerFactory, clientset.Interface) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) config := restclient.Config{Host: s.URL} clientSet, err := clientset.NewForConfig(&config) diff --git a/test/integration/scheduler/scheduler_test.go b/test/integration/scheduler/scheduler_test.go index 2249aac03f3..4fc2ec58260 100644 --- a/test/integration/scheduler/scheduler_test.go +++ b/test/integration/scheduler/scheduler_test.go @@ -55,7 +55,7 @@ type nodeStateManager struct { // from configurations provided by a ConfigMap object and then verifies that the // configuration is applied correctly. func TestSchedulerCreationFromConfigMap(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("configmap", s, t) @@ -316,7 +316,7 @@ priorities: [] // TestSchedulerCreationFromNonExistentConfigMap ensures that creation of the // scheduler from a non-existent ConfigMap fails. func TestSchedulerCreationFromNonExistentConfigMap(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("configmap", s, t) diff --git a/test/integration/secrets/secrets_test.go b/test/integration/secrets/secrets_test.go index b10751b414d..627ec9e38c5 100644 --- a/test/integration/secrets/secrets_test.go +++ b/test/integration/secrets/secrets_test.go @@ -39,7 +39,7 @@ func deleteSecretOrErrorf(t *testing.T, c clientset.Interface, ns, name string) // TestSecrets tests apiserver-side behavior of creation of secret objects and their use by pods. func TestSecrets(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: &schema.GroupVersion{Group: "", Version: "v1"}}}) diff --git a/test/integration/service/loadbalancer_test.go b/test/integration/service/loadbalancer_test.go index a2032fb60f2..0dafcc839c4 100644 --- a/test/integration/service/loadbalancer_test.go +++ b/test/integration/service/loadbalancer_test.go @@ -37,7 +37,7 @@ func Test_ServiceLoadBalancerDisableAllocateNodePorts(t *testing.T) { defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.ServiceLBNodePortControl, true)() masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, server, closeFn := framework.RunAMaster(masterConfig) + _, server, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() config := restclient.Config{Host: server.URL} @@ -81,7 +81,7 @@ func Test_ServiceLoadBalancerEnableThenDisableAllocatedNodePorts(t *testing.T) { defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.ServiceLBNodePortControl, true)() masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, server, closeFn := framework.RunAMaster(masterConfig) + _, server, closeFn := framework.RunAnAPIServer(masterConfig) defer closeFn() config := restclient.Config{Host: server.URL} diff --git a/test/integration/serviceaccount/service_account_test.go b/test/integration/serviceaccount/service_account_test.go index c18263ed22d..c7b6eadd7b7 100644 --- a/test/integration/serviceaccount/service_account_test.go +++ b/test/integration/serviceaccount/service_account_test.go @@ -405,7 +405,7 @@ func startServiceAccountTestServer(t *testing.T) (*clientset.Clientset, restclie masterConfig.GenericConfig.Authentication.Authenticator = authenticator masterConfig.GenericConfig.Authorization.Authorizer = authorizer masterConfig.GenericConfig.AdmissionControl = serviceAccountAdmission - _, _, kubeAPIServerCloseFn := framework.RunAnApiserverUsingServer(masterConfig, apiServer, h) + _, _, kubeAPIServerCloseFn := framework.RunAnAPIServerUsingServer(masterConfig, apiServer, h) // Start the service account and service account token controllers stopCh := make(chan struct{}) diff --git a/test/integration/statefulset/util.go b/test/integration/statefulset/util.go index 15105519744..2c5ba27147a 100644 --- a/test/integration/statefulset/util.go +++ b/test/integration/statefulset/util.go @@ -160,7 +160,7 @@ func newStatefulSetPVC(name string) v1.PersistentVolumeClaim { // scSetup sets up necessities for Statefulset integration test, including master, apiserver, informers, and clientset func scSetup(t *testing.T) (*httptest.Server, framework.CloseFunc, *statefulset.StatefulSetController, informers.SharedInformerFactory, clientset.Interface) { masterConfig := framework.NewIntegrationTestControlPlaneConfig() - _, s, closeFn := framework.RunAMaster(masterConfig) + _, s, closeFn := framework.RunAnAPIServer(masterConfig) config := restclient.Config{Host: s.URL} clientSet, err := clientset.NewForConfig(&config) diff --git a/test/integration/storageclasses/storage_classes_test.go b/test/integration/storageclasses/storage_classes_test.go index c8ee33d452f..9485d9b289d 100644 --- a/test/integration/storageclasses/storage_classes_test.go +++ b/test/integration/storageclasses/storage_classes_test.go @@ -36,7 +36,7 @@ const provisionerPluginName = "kubernetes.io/mock-provisioner" // TestStorageClasses tests apiserver-side behavior of creation of storage class objects and their use by pvcs. func TestStorageClasses(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL, ContentConfig: restclient.ContentConfig{GroupVersion: &schema.GroupVersion{Group: "", Version: "v1"}}}) diff --git a/test/integration/ttlcontroller/ttlcontroller_test.go b/test/integration/ttlcontroller/ttlcontroller_test.go index 31cd74a2c1c..c0895864a1f 100644 --- a/test/integration/ttlcontroller/ttlcontroller_test.go +++ b/test/integration/ttlcontroller/ttlcontroller_test.go @@ -134,7 +134,7 @@ func waitForNodesWithTTLAnnotation(t *testing.T, nodeLister listers.NodeLister, // Test whether ttlcontroller sets correct ttl annotations. func TestTTLAnnotations(t *testing.T) { - _, server, closeFn := framework.RunAMaster(nil) + _, server, closeFn := framework.RunAnAPIServer(nil) defer closeFn() testClient, informers := createClientAndInformers(t, server) diff --git a/test/integration/util/util.go b/test/integration/util/util.go index feacca6240e..3e1efba9259 100644 --- a/test/integration/util/util.go +++ b/test/integration/util/util.go @@ -62,7 +62,7 @@ func StartApiserver() (string, ShutdownFunc) { h.M.GenericAPIServer.Handler.ServeHTTP(w, req) })) - _, _, closeFn := framework.RunAnApiserverUsingServer(framework.NewIntegrationTestControlPlaneConfig(), s, h) + _, _, closeFn := framework.RunAnAPIServerUsingServer(framework.NewIntegrationTestControlPlaneConfig(), s, h) shutdownFunc := func() { klog.Infof("destroying API server") @@ -342,7 +342,7 @@ func InitTestMaster(t *testing.T, nsPrefix string, admission admission.Interface masterConfig.GenericConfig.AdmissionControl = admission } - _, testCtx.HTTPServer, testCtx.CloseFn = framework.RunAnApiserverUsingServer(masterConfig, s, h) + _, testCtx.HTTPServer, testCtx.CloseFn = framework.RunAnAPIServerUsingServer(masterConfig, s, h) if nsPrefix != "default" { testCtx.NS = framework.CreateTestingNamespace(nsPrefix+string(uuid.NewUUID()), s, t) diff --git a/test/integration/volume/attach_detach_test.go b/test/integration/volume/attach_detach_test.go index aa0ffb8c597..cf458feedcc 100644 --- a/test/integration/volume/attach_detach_test.go +++ b/test/integration/volume/attach_detach_test.go @@ -144,7 +144,7 @@ var defaultTimerConfig = attachdetach.TimerConfig{ // event is somehow missed by AttachDetach controller - it still // gets cleaned up by Desired State of World populator. func TestPodDeletionWithDswp(t *testing.T) { - _, server, closeFn := framework.RunAMaster(framework.NewIntegrationTestControlPlaneConfig()) + _, server, closeFn := framework.RunAnAPIServer(framework.NewIntegrationTestControlPlaneConfig()) defer closeFn() namespaceName := "test-pod-deletion" node := &v1.Node{ @@ -218,7 +218,7 @@ func initCSIObjects(stopCh chan struct{}, informers clientgoinformers.SharedInfo } func TestPodUpdateWithWithADC(t *testing.T) { - _, server, closeFn := framework.RunAMaster(framework.NewIntegrationTestControlPlaneConfig()) + _, server, closeFn := framework.RunAnAPIServer(framework.NewIntegrationTestControlPlaneConfig()) defer closeFn() namespaceName := "test-pod-update" @@ -287,7 +287,7 @@ func TestPodUpdateWithWithADC(t *testing.T) { } func TestPodUpdateWithKeepTerminatedPodVolumes(t *testing.T) { - _, server, closeFn := framework.RunAMaster(framework.NewIntegrationTestControlPlaneConfig()) + _, server, closeFn := framework.RunAnAPIServer(framework.NewIntegrationTestControlPlaneConfig()) defer closeFn() namespaceName := "test-pod-update" @@ -471,7 +471,7 @@ func createAdClients(ns *v1.Namespace, t *testing.T, server *httptest.Server, sy // event is somehow missed by AttachDetach controller - it still // gets added by Desired State of World populator. func TestPodAddedByDswp(t *testing.T) { - _, server, closeFn := framework.RunAMaster(framework.NewIntegrationTestControlPlaneConfig()) + _, server, closeFn := framework.RunAnAPIServer(framework.NewIntegrationTestControlPlaneConfig()) defer closeFn() namespaceName := "test-pod-deletion" @@ -546,7 +546,7 @@ func TestPodAddedByDswp(t *testing.T) { } func TestPVCBoundWithADC(t *testing.T) { - _, server, closeFn := framework.RunAMaster(framework.NewIntegrationTestControlPlaneConfig()) + _, server, closeFn := framework.RunAnAPIServer(framework.NewIntegrationTestControlPlaneConfig()) defer closeFn() namespaceName := "test-pod-deletion" diff --git a/test/integration/volume/persistent_volumes_test.go b/test/integration/volume/persistent_volumes_test.go index a8711b1cb53..35d19bf26da 100644 --- a/test/integration/volume/persistent_volumes_test.go +++ b/test/integration/volume/persistent_volumes_test.go @@ -105,7 +105,7 @@ func testSleep() { func TestPersistentVolumeRecycler(t *testing.T) { klog.V(2).Infof("TestPersistentVolumeRecycler started") - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("pv-recycler", s, t) @@ -160,7 +160,7 @@ func TestPersistentVolumeRecycler(t *testing.T) { func TestPersistentVolumeDeleter(t *testing.T) { klog.V(2).Infof("TestPersistentVolumeDeleter started") - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("pv-deleter", s, t) @@ -220,7 +220,7 @@ func TestPersistentVolumeBindRace(t *testing.T) { // Test a race binding many claims to a PV that is pre-bound to a specific // PVC. Only this specific PVC should get bound. klog.V(2).Infof("TestPersistentVolumeBindRace started") - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("pv-bind-race", s, t) @@ -290,7 +290,7 @@ func TestPersistentVolumeBindRace(t *testing.T) { // TestPersistentVolumeClaimLabelSelector test binding using label selectors func TestPersistentVolumeClaimLabelSelector(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("pvc-label-selector", s, t) @@ -371,7 +371,7 @@ func TestPersistentVolumeClaimLabelSelector(t *testing.T) { // TestPersistentVolumeClaimLabelSelectorMatchExpressions test binding using // MatchExpressions label selectors func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("pvc-match-expressions", s, t) @@ -471,7 +471,7 @@ func TestPersistentVolumeClaimLabelSelectorMatchExpressions(t *testing.T) { // TestPersistentVolumeMultiPVs tests binding of one PVC to 100 PVs with // different size. func TestPersistentVolumeMultiPVs(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("multi-pvs", s, t) @@ -561,7 +561,7 @@ func TestPersistentVolumeMultiPVs(t *testing.T) { // TestPersistentVolumeMultiPVsPVCs tests binding of 100 PVC to 100 PVs. // This test is configurable by KUBE_INTEGRATION_PV_* variables. func TestPersistentVolumeMultiPVsPVCs(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("multi-pvs-pvcs", s, t) @@ -721,7 +721,7 @@ func TestPersistentVolumeMultiPVsPVCs(t *testing.T) { // TestPersistentVolumeControllerStartup tests startup of the controller. // The controller should not unbind any volumes when it starts. func TestPersistentVolumeControllerStartup(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("controller-startup", s, t) @@ -850,7 +850,7 @@ func TestPersistentVolumeControllerStartup(t *testing.T) { // TestPersistentVolumeProvisionMultiPVCs tests provisioning of many PVCs. // This test is configurable by KUBE_INTEGRATION_PV_* variables. func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("provision-multi-pvs", s, t) @@ -945,7 +945,7 @@ func TestPersistentVolumeProvisionMultiPVCs(t *testing.T) { // TestPersistentVolumeMultiPVsDiffAccessModes tests binding of one PVC to two // PVs with different access modes. func TestPersistentVolumeMultiPVsDiffAccessModes(t *testing.T) { - _, s, closeFn := framework.RunAMaster(nil) + _, s, closeFn := framework.RunAnAPIServer(nil) defer closeFn() ns := framework.CreateTestingNamespace("multi-pvs-diff-access", s, t) diff --git a/test/integration/volumescheduling/util.go b/test/integration/volumescheduling/util.go index a4842e53a79..da4af6a5807 100644 --- a/test/integration/volumescheduling/util.go +++ b/test/integration/volumescheduling/util.go @@ -85,7 +85,7 @@ func initTestMaster(t *testing.T, nsPrefix string, admission admission.Interface masterConfig.GenericConfig.AdmissionControl = admission } - _, testCtx.httpServer, testCtx.closeFn = framework.RunAnApiserverUsingServer(masterConfig, s, h) + _, testCtx.httpServer, testCtx.closeFn = framework.RunAnAPIServerUsingServer(masterConfig, s, h) if nsPrefix != "default" { testCtx.ns = framework.CreateTestingNamespace(nsPrefix+string(uuid.NewUUID()), s, t)