Skip to content

Commit

Permalink
Merge pull request #1271 from tosi3k/ep-pb
Browse files Browse the repository at this point in the history
Use protobuf encoding for core K8s APIs in external-provisioner
  • Loading branch information
k8s-ci-robot authored Sep 16, 2024
2 parents 7982c59 + 801088f commit 46212fd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/csi-provisioner/csi-provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import (
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/validation"
utilfeature "k8s.io/apiserver/pkg/util/feature"
Expand Down Expand Up @@ -184,7 +185,9 @@ func main() {
config.QPS = *kubeAPIQPS
config.Burst = *kubeAPIBurst

clientset, err := kubernetes.NewForConfig(config)
coreConfig := rest.CopyConfig(config)
coreConfig.ContentType = runtime.ContentTypeProtobuf
clientset, err := kubernetes.NewForConfig(coreConfig)
if err != nil {
klog.Fatalf("Failed to create client: %v", err)
}
Expand Down Expand Up @@ -657,7 +660,7 @@ func main() {
lockName := strings.Replace(provisionerName, "/", "-", -1)

// create a new clientset for leader election
leClientset, err := kubernetes.NewForConfig(config)
leClientset, err := kubernetes.NewForConfig(coreConfig)
if err != nil {
klog.Fatalf("Failed to create leaderelection client: %v", err)
}
Expand Down

0 comments on commit 46212fd

Please sign in to comment.