From cb875e0f8cbac3dece5b9bc463fb81ea5bcb3a5f Mon Sep 17 00:00:00 2001 From: Wojciech Tyczynski Date: Mon, 9 May 2016 10:57:26 +0200 Subject: [PATCH] Enable using protobufs in e2e tests --- test/e2e/framework/framework.go | 3 +++ test/e2e/framework/test_context.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/test/e2e/framework/framework.go b/test/e2e/framework/framework.go index 9730561375e..d855c753639 100644 --- a/test/e2e/framework/framework.go +++ b/test/e2e/framework/framework.go @@ -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 diff --git a/test/e2e/framework/test_context.go b/test/e2e/framework/test_context.go index 54511b6121f..dfbd729be55 100644 --- a/test/e2e/framework/test_context.go +++ b/test/e2e/framework/test_context.go @@ -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")