Merge pull request #25337 from wojtek-t/content_type_in_tests

Automatic merge from submit-queue

Enable using protobufs in e2e tests

ref #25132
pull/6/head
k8s-merge-robot 2016-05-09 02:50:03 -07:00
commit 761fc00234
2 changed files with 5 additions and 0 deletions

View File

@ -123,6 +123,9 @@ func (f *Framework) BeforeEach() {
Expect(err).NotTo(HaveOccurred())
config.QPS = f.options.ClientQPS
config.Burst = f.options.ClientBurst
if TestContext.KubeAPIContentType != "" {
config.ContentType = TestContext.KubeAPIContentType
}
c, err := loadClientFromConfig(config)
Expect(err).NotTo(HaveOccurred())
f.Client = c

View File

@ -28,6 +28,7 @@ import (
type TestContextType struct {
KubeConfig string
KubeContext string
KubeAPIContentType string
KubeVolumeDir string
CertDir string
Host string
@ -90,6 +91,7 @@ func RegisterFlags() {
flag.StringVar(&TestContext.KubeConfig, clientcmd.RecommendedConfigPathFlag, os.Getenv(clientcmd.RecommendedConfigPathEnvVar), "Path to kubeconfig containing embedded authinfo.")
flag.StringVar(&TestContext.KubeContext, clientcmd.FlagContext, "", "kubeconfig context to use/override. If unset, will use value from 'current-context'")
flag.StringVar(&TestContext.KubeAPIContentType, "kube-api-content-type", "", "ContentType used to communicate with apiserver")
flag.StringVar(&TestContext.KubeVolumeDir, "volume-dir", "/var/lib/kubelet", "Path to the directory containing the kubelet volumes.")
flag.StringVar(&TestContext.CertDir, "cert-dir", "", "Path to the directory containing the certs. Default is empty, which doesn't use certs.")
flag.StringVar(&TestContext.Host, "host", "", "The host, or apiserver, to connect to")