mirror of https://github.com/k3s-io/k3s
Merge pull request #25337 from wojtek-t/content_type_in_tests
Automatic merge from submit-queue Enable using protobufs in e2e tests ref #25132pull/6/head
commit
761fc00234
|
@ -123,6 +123,9 @@ func (f *Framework) BeforeEach() {
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
config.QPS = f.options.ClientQPS
|
config.QPS = f.options.ClientQPS
|
||||||
config.Burst = f.options.ClientBurst
|
config.Burst = f.options.ClientBurst
|
||||||
|
if TestContext.KubeAPIContentType != "" {
|
||||||
|
config.ContentType = TestContext.KubeAPIContentType
|
||||||
|
}
|
||||||
c, err := loadClientFromConfig(config)
|
c, err := loadClientFromConfig(config)
|
||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
f.Client = c
|
f.Client = c
|
||||||
|
|
|
@ -28,6 +28,7 @@ import (
|
||||||
type TestContextType struct {
|
type TestContextType struct {
|
||||||
KubeConfig string
|
KubeConfig string
|
||||||
KubeContext string
|
KubeContext string
|
||||||
|
KubeAPIContentType string
|
||||||
KubeVolumeDir string
|
KubeVolumeDir string
|
||||||
CertDir string
|
CertDir string
|
||||||
Host 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.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.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.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.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")
|
flag.StringVar(&TestContext.Host, "host", "", "The host, or apiserver, to connect to")
|
||||||
|
|
Loading…
Reference in New Issue