From c9ec4862872201851215ca5107252a3447473374 Mon Sep 17 00:00:00 2001 From: Mengjiao Liu Date: Tue, 25 May 2021 13:26:28 +0800 Subject: [PATCH] Part of master to controlplane in test/integration Rename NewIntegrationTestMasterConfig to NewIntegrationTestControlPlaneConfig --- .../apimachinery/watch_restart_test.go | 2 +- .../apimachinery/watch_timeout_test.go | 2 +- test/integration/apiserver/apiserver_test.go | 4 ++-- .../integration/apiserver/apply/apply_test.go | 4 ++-- .../apiserver/flowcontrol/concurrency_test.go | 2 +- test/integration/apiserver/watchcache_test.go | 2 +- 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 | 6 ++--- test/integration/auth/svcaccttoken_test.go | 2 +- test/integration/cronjob/cronjob_test.go | 2 +- test/integration/daemonset/daemonset_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 | 10 ++++----- test/integration/job/job_test.go | 2 +- .../master/synthetic_master_test.go | 8 +++---- .../namespace/ns_conditions_test.go | 2 +- test/integration/quota/quota_test.go | 4 ++-- .../integration/replicaset/replicaset_test.go | 4 ++-- .../replicationcontroller_test.go | 2 +- test/integration/service/loadbalancer_test.go | 4 ++-- test/integration/statefulset/util.go | 2 +- test/integration/util/util.go | 4 ++-- test/integration/volume/attach_detach_test.go | 10 ++++----- test/integration/volumescheduling/util.go | 2 +- 31 files changed, 72 insertions(+), 72 deletions(-) diff --git a/test/integration/apimachinery/watch_restart_test.go b/test/integration/apimachinery/watch_restart_test.go index d2b2945ba95..944177e8d11 100644 --- a/test/integration/apimachinery/watch_restart_test.go +++ b/test/integration/apimachinery/watch_restart_test.go @@ -67,7 +67,7 @@ func TestWatchRestartsIfTimeoutNotReached(t *testing.T) { timeout := 30 * time.Second // Set up a master - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() // Timeout is set random between MinRequestTimeout and 2x masterConfig.GenericConfig.MinRequestTimeout = int(timeout.Seconds()) / 4 _, s, closeFn := framework.RunAMaster(masterConfig) diff --git a/test/integration/apimachinery/watch_timeout_test.go b/test/integration/apimachinery/watch_timeout_test.go index cabd37cc6dc..dbd603b27e6 100644 --- a/test/integration/apimachinery/watch_timeout_test.go +++ b/test/integration/apimachinery/watch_timeout_test.go @@ -36,7 +36,7 @@ import ( ) func TestWatchClientTimeout(t *testing.T) { - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, s, closeFn := framework.RunAMaster(masterConfig) defer closeFn() diff --git a/test/integration/apiserver/apiserver_test.go b/test/integration/apiserver/apiserver_test.go index 94e6dae32cb..676a774b321 100644 --- a/test/integration/apiserver/apiserver_test.go +++ b/test/integration/apiserver/apiserver_test.go @@ -84,7 +84,7 @@ func setupWithResources(t *testing.T, groupVersions []schema.GroupVersion, resou } func setupWithResourcesWithOptions(t *testing.T, opts *framework.MasterConfigOptions, groupVersions []schema.GroupVersion, resources []schema.GroupVersionResource) (*httptest.Server, clientset.Interface, framework.CloseFunc) { - masterConfig := framework.NewIntegrationTestMasterConfigWithOptions(opts) + masterConfig := framework.NewIntegrationTestControlPlaneConfigWithOptions(opts) if len(groupVersions) > 0 || len(resources) > 0 { resourceConfig := controlplane.DefaultAPIResourceConfigSource() resourceConfig.EnableVersions(groupVersions...) @@ -224,7 +224,7 @@ func Test4xxStatusCodeInvalidPatch(t *testing.T) { } func TestCacheControl(t *testing.T) { - masterConfig := framework.NewIntegrationTestMasterConfigWithOptions(&framework.MasterConfigOptions{}) + masterConfig := framework.NewIntegrationTestControlPlaneConfigWithOptions(&framework.MasterConfigOptions{}) masterConfig.GenericConfig.OpenAPIConfig = framework.DefaultOpenAPIConfig() master, _, closeFn := framework.RunAMaster(masterConfig) defer closeFn() diff --git a/test/integration/apiserver/apply/apply_test.go b/test/integration/apiserver/apply/apply_test.go index dde9cf63ca2..c0bc5aa2131 100644 --- a/test/integration/apiserver/apply/apply_test.go +++ b/test/integration/apiserver/apply/apply_test.go @@ -52,7 +52,7 @@ import ( func setup(t testing.TB, groupVersions ...schema.GroupVersion) (*httptest.Server, clientset.Interface, framework.CloseFunc) { opts := framework.MasterConfigOptions{EtcdOptions: framework.DefaultEtcdOptions()} opts.EtcdOptions.DefaultStorageMediaType = "application/vnd.kubernetes.protobuf" - masterConfig := framework.NewIntegrationTestMasterConfigWithOptions(&opts) + masterConfig := framework.NewIntegrationTestControlPlaneConfigWithOptions(&opts) if len(groupVersions) > 0 { resourceConfig := controlplane.DefaultAPIResourceConfigSource() resourceConfig.EnableVersions(groupVersions...) @@ -2819,7 +2819,7 @@ spec: func TestStopTrackingManagedFieldsOnFeatureDisabled(t *testing.T) { sharedEtcd := framework.DefaultEtcdOptions() - masterConfig := framework.NewIntegrationTestMasterConfigWithOptions(&framework.MasterConfigOptions{ + masterConfig := framework.NewIntegrationTestControlPlaneConfigWithOptions(&framework.MasterConfigOptions{ EtcdOptions: sharedEtcd, }) masterConfig.GenericConfig.OpenAPIConfig = framework.DefaultOpenAPIConfig() diff --git a/test/integration/apiserver/flowcontrol/concurrency_test.go b/test/integration/apiserver/flowcontrol/concurrency_test.go index 4127947b232..4e5c1213c2f 100644 --- a/test/integration/apiserver/flowcontrol/concurrency_test.go +++ b/test/integration/apiserver/flowcontrol/concurrency_test.go @@ -52,7 +52,7 @@ const ( func setup(t testing.TB, maxReadonlyRequestsInFlight, MaxMutatingRequestsInFlight int) (*httptest.Server, *rest.Config, framework.CloseFunc) { opts := framework.MasterConfigOptions{EtcdOptions: framework.DefaultEtcdOptions()} opts.EtcdOptions.DefaultStorageMediaType = "application/vnd.kubernetes.protobuf" - masterConfig := framework.NewIntegrationTestMasterConfigWithOptions(&opts) + masterConfig := framework.NewIntegrationTestControlPlaneConfigWithOptions(&opts) resourceConfig := controlplane.DefaultAPIResourceConfigSource() resourceConfig.EnableVersions(schema.GroupVersion{ Group: "flowcontrol.apiserver.k8s.io", diff --git a/test/integration/apiserver/watchcache_test.go b/test/integration/apiserver/watchcache_test.go index f29c8d6cd9d..bf31ae45df7 100644 --- a/test/integration/apiserver/watchcache_test.go +++ b/test/integration/apiserver/watchcache_test.go @@ -55,7 +55,7 @@ func multiEtcdSetup(t testing.TB) (clientset.Interface, framework.CloseFunc) { etcdOptions.EnableWatchCache = true opts := framework.MasterConfigOptions{EtcdOptions: etcdOptions} - masterConfig := framework.NewIntegrationTestMasterConfigWithOptions(&opts) + masterConfig := framework.NewIntegrationTestControlPlaneConfigWithOptions(&opts) // Switch off endpoints reconciler to avoid unnecessary operations. masterConfig.ExtraConfig.EndpointReconcilerType = reconcilers.NoneEndpointReconcilerType _, s, stopMaster := framework.RunAMaster(masterConfig) diff --git a/test/integration/auth/accessreview_test.go b/test/integration/auth/accessreview_test.go index e5b8db9b571..837bcffc117 100644 --- a/test/integration/auth/accessreview_test.go +++ b/test/integration/auth/accessreview_test.go @@ -55,7 +55,7 @@ func alwaysAlice(req *http.Request) (*authenticator.Response, bool, error) { } func TestSubjectAccessReview(t *testing.T) { - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = authenticator.RequestFunc(alwaysAlice) masterConfig.GenericConfig.Authorization.Authorizer = sarAuthorizer{} _, s, closeFn := framework.RunAMaster(masterConfig) @@ -146,7 +146,7 @@ func TestSubjectAccessReview(t *testing.T) { func TestSelfSubjectAccessReview(t *testing.T) { username := "alice" - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = authenticator.RequestFunc(func(req *http.Request) (*authenticator.Response, bool, error) { return &authenticator.Response{ User: &user.DefaultInfo{Name: username}, @@ -229,7 +229,7 @@ func TestSelfSubjectAccessReview(t *testing.T) { } func TestLocalSubjectAccessReview(t *testing.T) { - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = authenticator.RequestFunc(alwaysAlice) masterConfig.GenericConfig.Authorization.Authorizer = sarAuthorizer{} _, s, closeFn := framework.RunAMaster(masterConfig) diff --git a/test/integration/auth/auth_test.go b/test/integration/auth/auth_test.go index 4cbf2b02a5e..ec2c9cb0e75 100644 --- a/test/integration/auth/auth_test.go +++ b/test/integration/auth/auth_test.go @@ -440,7 +440,7 @@ func getTestRequests(namespace string) []struct { // TODO(etune): write a fuzz test of the REST API. func TestAuthModeAlwaysAllow(t *testing.T) { // Set up a master - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, s, closeFn := framework.RunAMaster(masterConfig) defer closeFn() @@ -537,7 +537,7 @@ func getPreviousResourceVersionKey(url, id string) string { func TestAuthModeAlwaysDeny(t *testing.T) { // Set up a master - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authorization.Authorizer = authorizerfactory.NewAlwaysDenyAuthorizer() _, s, closeFn := framework.RunAMaster(masterConfig) defer closeFn() @@ -586,7 +586,7 @@ func TestAliceNotForbiddenOrUnauthorized(t *testing.T) { // This file has alice and bob in it. // Set up a master - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = allowAliceAuthorizer{} _, s, closeFn := framework.RunAMaster(masterConfig) @@ -655,7 +655,7 @@ func TestAliceNotForbiddenOrUnauthorized(t *testing.T) { // should receive "Forbidden". func TestBobIsForbidden(t *testing.T) { // This file has alice and bob in it. - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = allowAliceAuthorizer{} _, s, closeFn := framework.RunAMaster(masterConfig) @@ -699,7 +699,7 @@ func TestUnknownUserIsUnauthorized(t *testing.T) { // This file has alice and bob in it. // Set up a master - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = allowAliceAuthorizer{} _, s, closeFn := framework.RunAMaster(masterConfig) @@ -761,7 +761,7 @@ func (impersonateAuthorizer) Authorize(ctx context.Context, a authorizer.Attribu func TestImpersonateIsForbidden(t *testing.T) { // Set up a master - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = impersonateAuthorizer{} _, s, closeFn := framework.RunAMaster(masterConfig) @@ -908,7 +908,7 @@ func TestAuthorizationAttributeDetermination(t *testing.T) { trackingAuthorizer := &trackingAuthorizer{} // Set up a master - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = trackingAuthorizer _, s, closeFn := framework.RunAMaster(masterConfig) @@ -974,7 +974,7 @@ func TestNamespaceAuthorization(t *testing.T) { `) // Set up a master - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = a _, s, closeFn := framework.RunAMaster(masterConfig) @@ -1072,7 +1072,7 @@ func TestKindAuthorization(t *testing.T) { `) // Set up a master - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = a _, s, closeFn := framework.RunAMaster(masterConfig) @@ -1156,7 +1156,7 @@ func TestReadOnlyAuthorization(t *testing.T) { a := newAuthorizerWithContents(t, `{"readonly": true}`) // Set up a master - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = getTestTokenAuth() masterConfig.GenericConfig.Authorization.Authorizer = a _, s, closeFn := framework.RunAMaster(masterConfig) @@ -1233,7 +1233,7 @@ func testWebhookTokenAuthenticator(customDialer bool, t *testing.T) { } // Set up a master - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = authenticator masterConfig.GenericConfig.Authorization.Authorizer = allowAliceAuthorizer{} _, s, closeFn := framework.RunAMaster(masterConfig) diff --git a/test/integration/auth/bootstraptoken_test.go b/test/integration/auth/bootstraptoken_test.go index 1fb610f60ba..21973337fab 100644 --- a/test/integration/auth/bootstraptoken_test.go +++ b/test/integration/auth/bootstraptoken_test.go @@ -117,7 +117,7 @@ func TestBootstrapTokenAuth(t *testing.T) { authenticator := bearertoken.New(bootstrap.NewTokenAuthenticator(bootstrapSecrets{test.secret})) // Set up a master - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authentication.Authenticator = authenticator _, s, closeFn := framework.RunAMaster(masterConfig) defer closeFn() diff --git a/test/integration/auth/rbac_test.go b/test/integration/auth/rbac_test.go index 0286537ac22..3347e162364 100644 --- a/test/integration/auth/rbac_test.go +++ b/test/integration/auth/rbac_test.go @@ -519,7 +519,7 @@ func TestRBAC(t *testing.T) { for i, tc := range tests { // Create an API Server. - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authorization.Authorizer = newRBACAuthorizer(t, masterConfig) masterConfig.GenericConfig.Authentication.Authenticator = bearertoken.New(tokenfile.New(map[string]*user.DefaultInfo{ superUser: {Name: "admin", Groups: []string{"system:masters"}}, @@ -642,7 +642,7 @@ func TestRBAC(t *testing.T) { func TestBootstrapping(t *testing.T) { superUser := "admin/system:masters" - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authorization.Authorizer = newRBACAuthorizer(t, masterConfig) masterConfig.GenericConfig.Authentication.Authenticator = bearertoken.New(tokenfile.New(map[string]*user.DefaultInfo{ superUser: {Name: "admin", Groups: []string{"system:masters"}}, @@ -703,7 +703,7 @@ func TestDiscoveryUpgradeBootstrapping(t *testing.T) { superUser := "admin/system:masters" - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authorization.Authorizer = newRBACAuthorizer(t, masterConfig) masterConfig.GenericConfig.Authentication.Authenticator = bearertoken.New(tokenfile.New(map[string]*user.DefaultInfo{ superUser: {Name: "admin", Groups: []string{"system:masters"}}, diff --git a/test/integration/auth/svcaccttoken_test.go b/test/integration/auth/svcaccttoken_test.go index 68412d54e4d..8f90c289014 100644 --- a/test/integration/auth/svcaccttoken_test.go +++ b/test/integration/auth/svcaccttoken_test.go @@ -83,7 +83,7 @@ func TestServiceAccountTokenCreate(t *testing.T) { gcs := &clientset.Clientset{} // Start the server - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authorization.Authorizer = authorizerfactory.NewAlwaysAllowAuthorizer() masterConfig.GenericConfig.Authentication.APIAudiences = aud masterConfig.GenericConfig.Authentication.Authenticator = bearertoken.New( diff --git a/test/integration/cronjob/cronjob_test.go b/test/integration/cronjob/cronjob_test.go index 888487f6118..aed05d72901 100644 --- a/test/integration/cronjob/cronjob_test.go +++ b/test/integration/cronjob/cronjob_test.go @@ -38,7 +38,7 @@ import ( ) func setup(t *testing.T) (*httptest.Server, framework.CloseFunc, *cronjob.Controller, *job.Controller, informers.SharedInformerFactory, clientset.Interface, restclient.Config) { - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, server, closeFn := framework.RunAMaster(masterConfig) config := restclient.Config{Host: server.URL} diff --git a/test/integration/daemonset/daemonset_test.go b/test/integration/daemonset/daemonset_test.go index 60914029c8e..c4d27c098ce 100644 --- a/test/integration/daemonset/daemonset_test.go +++ b/test/integration/daemonset/daemonset_test.go @@ -52,7 +52,7 @@ import ( var zero = int64(0) func setup(t *testing.T) (*httptest.Server, framework.CloseFunc, *daemon.DaemonSetsController, informers.SharedInformerFactory, clientset.Interface) { - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, server, closeFn := framework.RunAMaster(masterConfig) config := restclient.Config{Host: server.URL} diff --git a/test/integration/deployment/util.go b/test/integration/deployment/util.go index 60bc00f5888..3c17bcee313 100644 --- a/test/integration/deployment/util.go +++ b/test/integration/deployment/util.go @@ -103,7 +103,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.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, s, closeFn := framework.RunAMaster(masterConfig) config := restclient.Config{Host: s.URL} @@ -135,7 +135,7 @@ func dcSetup(t *testing.T) (*httptest.Server, framework.CloseFunc, *replicaset.R // dcSimpleSetup sets up necessities for Deployment integration test, including master, apiserver, // and clientset, but not controllers and informers func dcSimpleSetup(t *testing.T) (*httptest.Server, framework.CloseFunc, clientset.Interface) { - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, s, closeFn := framework.RunAMaster(masterConfig) config := restclient.Config{Host: s.URL} diff --git a/test/integration/dualstack/dualstack_endpoints_test.go b/test/integration/dualstack/dualstack_endpoints_test.go index a4c98dea26d..ca7f8f0448f 100644 --- a/test/integration/dualstack/dualstack_endpoints_test.go +++ b/test/integration/dualstack/dualstack_endpoints_test.go @@ -51,7 +51,7 @@ func TestDualStackEndpoints(t *testing.T) { dualStack := true defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IPv6DualStack, dualStack)() - cfg := framework.NewIntegrationTestMasterConfig() + cfg := framework.NewIntegrationTestControlPlaneConfig() _, cidr, err := net.ParseCIDR(serviceCIDR) if err != nil { t.Fatalf("Bad cidr: %v", err) diff --git a/test/integration/dualstack/dualstack_test.go b/test/integration/dualstack/dualstack_test.go index 8b4d692502b..584a8fe51c8 100644 --- a/test/integration/dualstack/dualstack_test.go +++ b/test/integration/dualstack/dualstack_test.go @@ -53,7 +53,7 @@ func TestCreateServiceSingleStackIPv4(t *testing.T) { serviceCIDR := "10.0.0.0/16" defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IPv6DualStack, true)() - cfg := framework.NewIntegrationTestMasterConfig() + cfg := framework.NewIntegrationTestControlPlaneConfig() _, cidr, err := net.ParseCIDR(serviceCIDR) if err != nil { t.Fatalf("bad cidr: %v", err) @@ -270,7 +270,7 @@ func TestCreateServiceDualStackIPv6(t *testing.T) { serviceCIDR := "2001:db8:1::/48" defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IPv6DualStack, true)() - cfg := framework.NewIntegrationTestMasterConfig() + cfg := framework.NewIntegrationTestControlPlaneConfig() _, cidr, err := net.ParseCIDR(serviceCIDR) if err != nil { t.Fatalf("bad cidr: %v", err) @@ -490,7 +490,7 @@ func TestCreateServiceDualStackIPv4IPv6(t *testing.T) { secondaryServiceCIDR := "2001:db8:1::/48" defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IPv6DualStack, true)() - cfg := framework.NewIntegrationTestMasterConfig() + cfg := framework.NewIntegrationTestControlPlaneConfig() _, cidr, err := net.ParseCIDR(serviceCIDR) if err != nil { t.Fatalf("bad cidr: %v", err) @@ -717,7 +717,7 @@ func TestCreateServiceDualStackIPv6IPv4(t *testing.T) { secondaryServiceCIDR := "10.0.0.0/16" defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IPv6DualStack, true)() - cfg := framework.NewIntegrationTestMasterConfig() + cfg := framework.NewIntegrationTestControlPlaneConfig() _, cidr, err := net.ParseCIDR(serviceCIDR) if err != nil { t.Fatalf("bad cidr: %v", err) @@ -947,7 +947,7 @@ func TestUpgradeDowngrade(t *testing.T) { secondaryServiceCIDR := "2001:db8:1::/48" defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IPv6DualStack, true)() - cfg := framework.NewIntegrationTestMasterConfig() + cfg := framework.NewIntegrationTestControlPlaneConfig() _, cidr, err := net.ParseCIDR(serviceCIDR) if err != nil { t.Fatalf("bad cidr: %v", err) @@ -1062,7 +1062,7 @@ func TestConvertToFromExternalName(t *testing.T) { secondaryServiceCIDR := "2001:db8:1::/48" defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IPv6DualStack, true)() - cfg := framework.NewIntegrationTestMasterConfig() + cfg := framework.NewIntegrationTestControlPlaneConfig() _, cidr, err := net.ParseCIDR(serviceCIDR) if err != nil { t.Fatalf("bad cidr: %v", err) @@ -1152,7 +1152,7 @@ func TestConvertToFromExternalName(t *testing.T) { func TestExistingServiceDefaulting(t *testing.T) { // Create an IPv4IPv6 dual stack control-plane serviceCIDR := "10.0.0.0/16" - cfg := framework.NewIntegrationTestMasterConfig() + cfg := framework.NewIntegrationTestControlPlaneConfig() _, cidr, err := net.ParseCIDR(serviceCIDR) if err != nil { t.Fatalf("bad cidr: %v", err) @@ -1235,7 +1235,7 @@ func TestPreferDualStack(t *testing.T) { secondaryServiceCIDR := "2001:db8:1::/48" defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IPv6DualStack, true)() - cfg := framework.NewIntegrationTestMasterConfig() + cfg := framework.NewIntegrationTestControlPlaneConfig() _, cidr, err := net.ParseCIDR(serviceCIDR) if err != nil { t.Fatalf("bad cidr: %v", err) @@ -1320,7 +1320,7 @@ func TestServiceUpdate(t *testing.T) { serviceCIDR := "10.0.0.0/16" defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IPv6DualStack, false)() - cfg := framework.NewIntegrationTestMasterConfig() + cfg := framework.NewIntegrationTestControlPlaneConfig() _, cidr, err := net.ParseCIDR(serviceCIDR) if err != nil { t.Fatalf("bad cidr: %v", err) diff --git a/test/integration/endpoints/endpoints_test.go b/test/integration/endpoints/endpoints_test.go index 2f28f59af82..054da964ff6 100644 --- a/test/integration/endpoints/endpoints_test.go +++ b/test/integration/endpoints/endpoints_test.go @@ -33,7 +33,7 @@ import ( ) func TestEndpointUpdates(t *testing.T) { - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, server, closeFn := framework.RunAMaster(masterConfig) defer closeFn() diff --git a/test/integration/endpointslice/endpointslicemirroring_test.go b/test/integration/endpointslice/endpointslicemirroring_test.go index fcee245cf25..c9dc13a2092 100644 --- a/test/integration/endpointslice/endpointslicemirroring_test.go +++ b/test/integration/endpointslice/endpointslicemirroring_test.go @@ -39,7 +39,7 @@ import ( ) func TestEndpointSliceMirroring(t *testing.T) { - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, server, closeFn := framework.RunAMaster(masterConfig) defer closeFn() @@ -233,7 +233,7 @@ func TestEndpointSliceMirroring(t *testing.T) { } func TestEndpointSliceMirroringUpdates(t *testing.T) { - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, server, closeFn := framework.RunAMaster(masterConfig) defer closeFn() diff --git a/test/integration/evictions/evictions_test.go b/test/integration/evictions/evictions_test.go index 2c2d4144808..4c50a88641c 100644 --- a/test/integration/evictions/evictions_test.go +++ b/test/integration/evictions/evictions_test.go @@ -421,7 +421,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.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, s, closeFn := framework.RunAMaster(masterConfig) config := restclient.Config{Host: s.URL} diff --git a/test/integration/framework/master_utils.go b/test/integration/framework/master_utils.go index 8dd63db04bc..86b6148f4d9 100644 --- a/test/integration/framework/master_utils.go +++ b/test/integration/framework/master_utils.go @@ -251,14 +251,14 @@ func startApiserverOrDie(controlPlaneConfig *controlplane.Config, incomingServer return m, s, closeFn } -// NewIntegrationTestMasterConfig returns the master config appropriate for most integration tests. -func NewIntegrationTestMasterConfig() *controlplane.Config { - return NewIntegrationTestMasterConfigWithOptions(&MasterConfigOptions{}) +// NewIntegrationTestControlPlaneConfig returns the master config appropriate for most integration tests. +func NewIntegrationTestControlPlaneConfig() *controlplane.Config { + return NewIntegrationTestControlPlaneConfigWithOptions(&MasterConfigOptions{}) } -// NewIntegrationTestMasterConfigWithOptions returns the master config appropriate for most integration tests +// NewIntegrationTestControlPlaneConfigWithOptions returns the master config appropriate for most integration tests // configured with the provided options. -func NewIntegrationTestMasterConfigWithOptions(opts *MasterConfigOptions) *controlplane.Config { +func NewIntegrationTestControlPlaneConfigWithOptions(opts *MasterConfigOptions) *controlplane.Config { masterConfig := NewMasterConfigWithOptions(opts) masterConfig.GenericConfig.PublicAddress = net.ParseIP("192.168.10.4") masterConfig.ExtraConfig.APIResourceConfigSource = controlplane.DefaultAPIResourceConfigSource() diff --git a/test/integration/job/job_test.go b/test/integration/job/job_test.go index 75cc705cd27..fdcba899593 100644 --- a/test/integration/job/job_test.go +++ b/test/integration/job/job_test.go @@ -607,7 +607,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.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, server, masterCloseFn := framework.RunAMaster(masterConfig) config := restclient.Config{Host: server.URL} diff --git a/test/integration/master/synthetic_master_test.go b/test/integration/master/synthetic_master_test.go index e5c639bed93..970adff6aa7 100644 --- a/test/integration/master/synthetic_master_test.go +++ b/test/integration/master/synthetic_master_test.go @@ -140,13 +140,13 @@ func TestEmptyList(t *testing.T) { } func initStatusForbiddenControlPlaneConfig() *controlplane.Config { - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.Authorization.Authorizer = authorizerfactory.NewAlwaysDenyAuthorizer() return masterConfig } func initUnauthorizedControlPlaneConfig() *controlplane.Config { - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() tokenAuthenticator := tokentest.New() tokenAuthenticator.Tokens[AliceToken] = &user.DefaultInfo{Name: "alice", UID: "1"} tokenAuthenticator.Tokens[BobToken] = &user.DefaultInfo{Name: "bob", UID: "2"} @@ -601,7 +601,7 @@ func countEndpoints(eps *corev1.Endpoints) int { } func TestMasterService(t *testing.T) { - _, s, closeFn := framework.RunAMaster(framework.NewIntegrationTestMasterConfig()) + _, s, closeFn := framework.RunAMaster(framework.NewIntegrationTestControlPlaneConfig()) defer closeFn() client := clientset.NewForConfigOrDie(&restclient.Config{Host: s.URL}) @@ -637,7 +637,7 @@ func TestMasterService(t *testing.T) { } func TestServiceAlloc(t *testing.T) { - cfg := framework.NewIntegrationTestMasterConfig() + cfg := framework.NewIntegrationTestControlPlaneConfig() _, cidr, err := net.ParseCIDR("192.168.0.0/29") if err != nil { t.Fatalf("bad cidr: %v", err) diff --git a/test/integration/namespace/ns_conditions_test.go b/test/integration/namespace/ns_conditions_test.go index 4e8832b9762..e6915172533 100644 --- a/test/integration/namespace/ns_conditions_test.go +++ b/test/integration/namespace/ns_conditions_test.go @@ -165,7 +165,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.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, s, closeFn := framework.RunAMaster(masterConfig) config := restclient.Config{Host: s.URL} diff --git a/test/integration/quota/quota_test.go b/test/integration/quota/quota_test.go index 3874ac59cb9..01a3c58d09c 100644 --- a/test/integration/quota/quota_test.go +++ b/test/integration/quota/quota_test.go @@ -75,7 +75,7 @@ func TestQuota(t *testing.T) { admission.SetQuotaConfiguration(qca) defer close(admissionCh) - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.AdmissionControl = admission _, _, closeFn := framework.RunAnApiserverUsingServer(masterConfig, s, h) defer closeFn() @@ -275,7 +275,7 @@ func TestQuotaLimitedResourceDenial(t *testing.T) { admission.SetQuotaConfiguration(qca) defer close(admissionCh) - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() masterConfig.GenericConfig.AdmissionControl = admission _, _, closeFn := framework.RunAnApiserverUsingServer(masterConfig, s, h) defer closeFn() diff --git a/test/integration/replicaset/replicaset_test.go b/test/integration/replicaset/replicaset_test.go index 4fd96523389..fa744269f6f 100644 --- a/test/integration/replicaset/replicaset_test.go +++ b/test/integration/replicaset/replicaset_test.go @@ -118,7 +118,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.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, s, closeFn := framework.RunAMaster(masterConfig) config := restclient.Config{Host: s.URL} @@ -140,7 +140,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.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, s, closeFn := framework.RunAMaster(masterConfig) config := restclient.Config{Host: s.URL} diff --git a/test/integration/replicationcontroller/replicationcontroller_test.go b/test/integration/replicationcontroller/replicationcontroller_test.go index 99cda73552c..502dbcf8b55 100644 --- a/test/integration/replicationcontroller/replicationcontroller_test.go +++ b/test/integration/replicationcontroller/replicationcontroller_test.go @@ -111,7 +111,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.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, s, closeFn := framework.RunAMaster(masterConfig) config := restclient.Config{Host: s.URL} diff --git a/test/integration/service/loadbalancer_test.go b/test/integration/service/loadbalancer_test.go index 4887a849810..a2032fb60f2 100644 --- a/test/integration/service/loadbalancer_test.go +++ b/test/integration/service/loadbalancer_test.go @@ -36,7 +36,7 @@ import ( func Test_ServiceLoadBalancerDisableAllocateNodePorts(t *testing.T) { defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.ServiceLBNodePortControl, true)() - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, server, closeFn := framework.RunAMaster(masterConfig) defer closeFn() @@ -80,7 +80,7 @@ func Test_ServiceLoadBalancerDisableAllocateNodePorts(t *testing.T) { func Test_ServiceLoadBalancerEnableThenDisableAllocatedNodePorts(t *testing.T) { defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.ServiceLBNodePortControl, true)() - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, server, closeFn := framework.RunAMaster(masterConfig) defer closeFn() diff --git a/test/integration/statefulset/util.go b/test/integration/statefulset/util.go index 10528b7d562..15105519744 100644 --- a/test/integration/statefulset/util.go +++ b/test/integration/statefulset/util.go @@ -159,7 +159,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.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() _, s, closeFn := framework.RunAMaster(masterConfig) config := restclient.Config{Host: s.URL} diff --git a/test/integration/util/util.go b/test/integration/util/util.go index a913e1af4da..feacca6240e 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.NewIntegrationTestMasterConfig(), s, h) + _, _, closeFn := framework.RunAnApiserverUsingServer(framework.NewIntegrationTestControlPlaneConfig(), s, h) shutdownFunc := func() { klog.Infof("destroying API server") @@ -336,7 +336,7 @@ func InitTestMaster(t *testing.T, nsPrefix string, admission admission.Interface h.M.GenericAPIServer.Handler.ServeHTTP(w, req) })) - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() if admission != nil { masterConfig.GenericConfig.AdmissionControl = admission diff --git a/test/integration/volume/attach_detach_test.go b/test/integration/volume/attach_detach_test.go index 6530df1c874..aa0ffb8c597 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.NewIntegrationTestMasterConfig()) + _, server, closeFn := framework.RunAMaster(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.NewIntegrationTestMasterConfig()) + _, server, closeFn := framework.RunAMaster(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.NewIntegrationTestMasterConfig()) + _, server, closeFn := framework.RunAMaster(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.NewIntegrationTestMasterConfig()) + _, server, closeFn := framework.RunAMaster(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.NewIntegrationTestMasterConfig()) + _, server, closeFn := framework.RunAMaster(framework.NewIntegrationTestControlPlaneConfig()) defer closeFn() namespaceName := "test-pod-deletion" diff --git a/test/integration/volumescheduling/util.go b/test/integration/volumescheduling/util.go index 896eaca9076..a4842e53a79 100644 --- a/test/integration/volumescheduling/util.go +++ b/test/integration/volumescheduling/util.go @@ -71,7 +71,7 @@ func initTestMaster(t *testing.T, nsPrefix string, admission admission.Interface h.M.GenericAPIServer.Handler.ServeHTTP(w, req) })) - masterConfig := framework.NewIntegrationTestMasterConfig() + masterConfig := framework.NewIntegrationTestControlPlaneConfig() resourceConfig := controlplane.DefaultAPIResourceConfigSource() if utilfeature.DefaultFeatureGate.Enabled(features.CSIStorageCapacity) { resourceConfig.EnableVersions(schema.GroupVersion{