Skip to content

Commit

Permalink
Merge pull request #359 from tosi3k/netd-pb
Browse files Browse the repository at this point in the history
Use protobuf encoding for core K8s APIs in netd
  • Loading branch information
google-oss-prow[bot] authored Sep 9, 2024
2 parents 6c277ae + d653055 commit 602ea26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/metrics/collector/netlink_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"golang.org/x/sys/unix"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/cache"
Expand Down Expand Up @@ -128,6 +129,7 @@ func createPodWatch() error {
if err != nil {
return err
}
config.ContentType = runtime.ContentTypeProtobuf
// creates the clientset
clientset, err := kubernetes.NewForConfig(config)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions pkg/metrics/collector/pod_ip_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"time"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"

Expand Down Expand Up @@ -162,6 +163,7 @@ func NewPodIPMetricsCollector() (Collector, error) {
if err != nil {
return nil, fmt.Errorf("error creating in-cluster config: %v", err)
}
config.ContentType = runtime.ContentTypeProtobuf

clientset, err := kubernetes.NewForConfig(config)
if err != nil {
Expand Down

0 comments on commit 602ea26

Please sign in to comment.