@@ -37,6 +37,7 @@ import (
37
37
apierrors "k8s.io/apimachinery/pkg/api/errors"
38
38
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
39
39
"k8s.io/apimachinery/pkg/labels"
40
+ "k8s.io/apimachinery/pkg/runtime"
40
41
"k8s.io/apimachinery/pkg/runtime/schema"
41
42
"k8s.io/apimachinery/pkg/util/validation"
42
43
utilfeature "k8s.io/apiserver/pkg/util/feature"
@@ -184,7 +185,9 @@ func main() {
184
185
config .QPS = * kubeAPIQPS
185
186
config .Burst = * kubeAPIBurst
186
187
187
- clientset , err := kubernetes .NewForConfig (config )
188
+ coreConfig := rest .CopyConfig (config )
189
+ coreConfig .ContentType = runtime .ContentTypeProtobuf
190
+ clientset , err := kubernetes .NewForConfig (coreConfig )
188
191
if err != nil {
189
192
klog .Fatalf ("Failed to create client: %v" , err )
190
193
}
@@ -657,7 +660,7 @@ func main() {
657
660
lockName := strings .Replace (provisionerName , "/" , "-" , - 1 )
658
661
659
662
// create a new clientset for leader election
660
- leClientset , err := kubernetes .NewForConfig (config )
663
+ leClientset , err := kubernetes .NewForConfig (coreConfig )
661
664
if err != nil {
662
665
klog .Fatalf ("Failed to create leaderelection client: %v" , err )
663
666
}
0 commit comments