Merge pull request #9145 from caesarxuchao/hack/test-integration

enable v1 in hack/test-integration.go
pull/6/head
Brian Grant 2015-06-03 11:19:41 -07:00
commit 895ad68422
9 changed files with 42 additions and 1 deletions

View File

@ -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

View File

@ -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}

View File

@ -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 {

View File

@ -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

View File

@ -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) {

View File

@ -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()})

View File

@ -68,6 +68,7 @@ func TestSecrets(t *testing.T) {
APIPrefix: "/api",
Authorizer: apiserver.NewAlwaysAllowAuthorizer(),
AdmissionControl: admit.NewAlwaysAdmit(),
EnableV1: true,
})
framework.DeleteAllEtcdKeys()

View File

@ -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

View File

@ -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) {