Skip to content

Commit

Permalink
use protobuf content type instead of json for k8s client
Browse files Browse the repository at this point in the history
  • Loading branch information
bhavi-koduru committed Sep 23, 2024
1 parent ece7a09 commit 4cf8572
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,16 @@ func main() {
setupLog.Error(err, "unable to build REST config")
os.Exit(1)
}
clientSet, err := kubernetes.NewForConfig(restCFG)

clientSetRestConfig, err := config.BuildRestConfig(controllerCFG.RuntimeConfig)
if err != nil {
setupLog.Error(err, "unable to build REST config")
os.Exit(1)
}
clientSetRestConfig.AcceptContentTypes = "application/vnd.kubernetes.protobuf,application/json"
clientSetRestConfig.ContentType = "application/vnd.kubernetes.protobuf"

clientSet, err := kubernetes.NewForConfig(clientSetRestConfig)
if err != nil {
setupLog.Error(err, "unable to obtain clientSet")
os.Exit(1)
Expand Down

0 comments on commit 4cf8572

Please sign in to comment.