Skip to content

Commit

Permalink
Merge pull request #1154 from tosi3k/es-pb
Browse files Browse the repository at this point in the history
Use protobuf encoding for core K8s APIs in external-snapshotter
  • Loading branch information
k8s-ci-robot authored Sep 16, 2024
2 parents d5c03db + 5fd0af2 commit ba4e466
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion cmd/csi-snapshotter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (

v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
coreinformers "k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/scheme"
Expand Down Expand Up @@ -123,7 +124,9 @@ func main() {
config.QPS = (float32)(*kubeAPIQPS)
config.Burst = *kubeAPIBurst

kubeClient, err := kubernetes.NewForConfig(config)
coreConfig := rest.CopyConfig(config)
coreConfig.ContentType = runtime.ContentTypeProtobuf
kubeClient, err := kubernetes.NewForConfig(coreConfig)
if err != nil {
klog.Error(err.Error())
os.Exit(1)
Expand Down
5 changes: 4 additions & 1 deletion cmd/snapshot-controller/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"k8s.io/client-go/util/workqueue"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/wait"

klog "k8s.io/klog/v2"
Expand Down Expand Up @@ -166,7 +167,9 @@ func main() {
config.QPS = (float32)(*kubeAPIQPS)
config.Burst = *kubeAPIBurst

kubeClient, err := kubernetes.NewForConfig(config)
coreConfig := rest.CopyConfig(config)
coreConfig.ContentType = runtime.ContentTypeProtobuf
kubeClient, err := kubernetes.NewForConfig(coreConfig)
if err != nil {
klog.Error(err.Error())
os.Exit(1)
Expand Down

0 comments on commit ba4e466

Please sign in to comment.