diff --git a/cmd/integration/integration.go b/cmd/integration/integration.go index 2ce6376e42d..4fd597f4c13 100644 --- a/cmd/integration/integration.go +++ b/cmd/integration/integration.go @@ -165,6 +165,7 @@ func startComponents(firstManifestURL, secondManifestURL, apiVersion string) (st ReadOnlyPort: portNumber, PublicAddress: publicAddress, CacheTimeout: 2 * time.Second, + EnableV1: true, }) handler.delegate = m.Handler diff --git a/hack/test-integration.sh b/hack/test-integration.sh index 36153522c6f..699bd98d151 100755 --- a/hack/test-integration.sh +++ b/hack/test-integration.sh @@ -25,7 +25,8 @@ set -o pipefail KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. source "${KUBE_ROOT}/hack/lib/init.sh" # Comma separated list of API Versions that should be tested. -KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1beta3"} +KUBE_TEST_API_VERSIONS=${KUBE_TEST_API_VERSIONS:-"v1beta3,v1"} + KUBE_INTEGRATION_TEST_MAX_CONCURRENCY=${KUBE_INTEGRATION_TEST_MAX_CONCURRENCY:-"-1"} LOG_LEVEL=${LOG_LEVEL:-2} diff --git a/pkg/api/v1/conversion.go b/pkg/api/v1/conversion.go index 5240dde5456..e783dd6c014 100644 --- a/pkg/api/v1/conversion.go +++ b/pkg/api/v1/conversion.go @@ -117,6 +117,32 @@ func addConversionFuncs() { // If one of the conversion functions is malformed, detect it immediately. panic(err) } + err = api.Scheme.AddFieldLabelConversionFunc("v1", "Secret", + func(label, value string) (string, string, error) { + switch label { + case "type": + return label, value, nil + default: + return "", "", fmt.Errorf("field label not supported: %s", label) + } + }) + if err != nil { + // If one of the conversion functions is malformed, detect it immediately. + panic(err) + } + err = api.Scheme.AddFieldLabelConversionFunc("v1", "ServiceAccount", + func(label, value string) (string, string, error) { + switch label { + case "metadata.name": + return label, value, nil + default: + return "", "", fmt.Errorf("field label not supported: %s", label) + } + }) + if err != nil { + // If one of the conversion functions is malformed, detect it immediately. + panic(err) + } } func convert_v1_StatusDetails_To_api_StatusDetails(in *StatusDetails, out *api.StatusDetails, s conversion.Scope) error { diff --git a/test/integration/auth_test.go b/test/integration/auth_test.go index ada2c441df7..490127543b1 100644 --- a/test/integration/auth_test.go +++ b/test/integration/auth_test.go @@ -397,6 +397,7 @@ func TestAuthModeAlwaysAllow(t *testing.T) { APIPrefix: "/api", Authorizer: apiserver.NewAlwaysAllowAuthorizer(), AdmissionControl: admit.NewAlwaysAdmit(), + EnableV1: true, }) transport := http.DefaultTransport @@ -537,6 +538,7 @@ func TestAuthModeAlwaysDeny(t *testing.T) { APIPrefix: "/api", Authorizer: apiserver.NewAlwaysDenyAuthorizer(), AdmissionControl: admit.NewAlwaysAdmit(), + EnableV1: true, }) transport := http.DefaultTransport @@ -605,6 +607,7 @@ func TestAliceNotForbiddenOrUnauthorized(t *testing.T) { Authenticator: getTestTokenAuth(), Authorizer: allowAliceAuthorizer{}, AdmissionControl: admit.NewAlwaysAdmit(), + EnableV1: true, }) previousResourceVersion := make(map[string]float64) @@ -692,6 +695,7 @@ func TestBobIsForbidden(t *testing.T) { Authenticator: getTestTokenAuth(), Authorizer: allowAliceAuthorizer{}, AdmissionControl: admit.NewAlwaysAdmit(), + EnableV1: true, }) transport := http.DefaultTransport @@ -753,6 +757,7 @@ func TestUnknownUserIsUnauthorized(t *testing.T) { Authenticator: getTestTokenAuth(), Authorizer: allowAliceAuthorizer{}, AdmissionControl: admit.NewAlwaysAdmit(), + EnableV1: true, }) transport := http.DefaultTransport @@ -833,6 +838,7 @@ func TestNamespaceAuthorization(t *testing.T) { Authenticator: getTestTokenAuth(), Authorizer: a, AdmissionControl: admit.NewAlwaysAdmit(), + EnableV1: true, }) previousResourceVersion := make(map[string]float64) @@ -948,6 +954,7 @@ func TestKindAuthorization(t *testing.T) { Authenticator: getTestTokenAuth(), Authorizer: a, AdmissionControl: admit.NewAlwaysAdmit(), + EnableV1: true, }) previousResourceVersion := make(map[string]float64) @@ -1050,6 +1057,7 @@ func TestReadOnlyAuthorization(t *testing.T) { Authenticator: getTestTokenAuth(), Authorizer: a, AdmissionControl: admit.NewAlwaysAdmit(), + EnableV1: true, }) transport := http.DefaultTransport diff --git a/test/integration/framework/master_utils.go b/test/integration/framework/master_utils.go index 3ff952e3547..de8e91fff84 100644 --- a/test/integration/framework/master_utils.go +++ b/test/integration/framework/master_utils.go @@ -272,6 +272,7 @@ func RunAMaster(t *testing.T) (*master.Master, *httptest.Server) { APIPrefix: "/api", Authorizer: apiserver.NewAlwaysAllowAuthorizer(), AdmissionControl: admit.NewAlwaysAdmit(), + EnableV1: true, }) s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { diff --git a/test/integration/scheduler_test.go b/test/integration/scheduler_test.go index e1733929c7e..a8d7db1fd72 100644 --- a/test/integration/scheduler_test.go +++ b/test/integration/scheduler_test.go @@ -75,6 +75,7 @@ func TestUnschedulableNodes(t *testing.T) { APIPrefix: "/api", Authorizer: apiserver.NewAlwaysAllowAuthorizer(), AdmissionControl: admit.NewAlwaysAdmit(), + EnableV1: true, }) restClient := client.NewOrDie(&client.Config{Host: s.URL, Version: testapi.Version()}) diff --git a/test/integration/secret_test.go b/test/integration/secret_test.go index b6c0ed7d4df..85ffece763c 100644 --- a/test/integration/secret_test.go +++ b/test/integration/secret_test.go @@ -68,6 +68,7 @@ func TestSecrets(t *testing.T) { APIPrefix: "/api", Authorizer: apiserver.NewAlwaysAllowAuthorizer(), AdmissionControl: admit.NewAlwaysAdmit(), + EnableV1: true, }) framework.DeleteAllEtcdKeys() diff --git a/test/integration/service_account_test.go b/test/integration/service_account_test.go index 1c3d692b244..94667b15b0f 100644 --- a/test/integration/service_account_test.go +++ b/test/integration/service_account_test.go @@ -419,6 +419,7 @@ func startServiceAccountTestServer(t *testing.T) (*client.Client, client.Config, Authenticator: authenticator, Authorizer: authorizer, AdmissionControl: serviceAccountAdmission, + EnableV1: true, }) // Start the service account and service account token controllers diff --git a/test/integration/utils.go b/test/integration/utils.go index d8e5187b485..265c13beab3 100644 --- a/test/integration/utils.go +++ b/test/integration/utils.go @@ -82,6 +82,7 @@ func runAMaster(t *testing.T) (*master.Master, *httptest.Server) { APIPrefix: "/api", Authorizer: apiserver.NewAlwaysAllowAuthorizer(), AdmissionControl: admit.NewAlwaysAdmit(), + EnableV1: true, }) s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {