From 61d784a662fd5d4a288706d41b0c1ce0aeaceb0b Mon Sep 17 00:00:00 2001 From: Eric Lin Date: Fri, 15 Sep 2023 17:51:21 +0000 Subject: [PATCH] Allow setting content-type in command Signed-off-by: Eric Lin --- cluster-autoscaler/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cluster-autoscaler/main.go b/cluster-autoscaler/main.go index 975094311b44..93a23dd8a291 100644 --- a/cluster-autoscaler/main.go +++ b/cluster-autoscaler/main.go @@ -101,6 +101,7 @@ var ( address = flag.String("address", ":8085", "The address to expose prometheus metrics.") kubernetes = flag.String("kubernetes", "", "Kubernetes master location. Leave blank for default") kubeConfigFile = flag.String("kubeconfig", "", "Path to kubeconfig file with authorization and master location information.") + kubeAPIContentType = flag.String("kube-api-content-type", "application/vnd.kubernetes.protobuf", "Content type of requests sent to apiserver.") kubeClientBurst = flag.Int("kube-client-burst", rest.DefaultBurst, "Burst value for kubernetes client.") kubeClientQPS = flag.Float64("kube-client-qps", float64(rest.DefaultQPS), "QPS value for kubernetes client.") cloudConfig = flag.String("cloud-config", "", "The path to the cloud provider configuration file. Empty string for no configuration file.") @@ -408,6 +409,8 @@ func getKubeConfig() *rest.Config { klog.Fatalf("Failed to build Kubernetes client configuration: %v", err) } + kubeConfig.ContentType = *kubeAPIContentType + return kubeConfig }