Allow setting GroupVersion in e2e tests

This commit is contained in:
Maciej Szulik 2016-08-08 16:36:46 +02:00
parent fe53ec34cf
commit be928af9b3

View File

@ -35,6 +35,7 @@ import (
"k8s.io/kubernetes/federation/client/clientset_generated/federation_release_1_4"
"k8s.io/kubernetes/pkg/api"
apierrs "k8s.io/kubernetes/pkg/api/errors"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/client/clientset_generated/release_1_2"
"k8s.io/kubernetes/pkg/client/clientset_generated/release_1_3"
"k8s.io/kubernetes/pkg/client/restclient"
@ -103,8 +104,9 @@ type TestDataSummary interface {
}
type FrameworkOptions struct {
ClientQPS float32
ClientBurst int
ClientQPS float32
ClientBurst int
GroupVersion *unversioned.GroupVersion
}
// NewFramework makes a new framework and sets up a BeforeEach/AfterEach for
@ -180,6 +182,9 @@ func (f *Framework) BeforeEach() {
Expect(err).NotTo(HaveOccurred())
config.QPS = f.options.ClientQPS
config.Burst = f.options.ClientBurst
if f.options.GroupVersion != nil {
config.GroupVersion = f.options.GroupVersion
}
if TestContext.KubeAPIContentType != "" {
config.ContentType = TestContext.KubeAPIContentType
}