Kaynağa Gözat

add comment

Signed-off-by: r2k1 <yokree@gmail.com>
r2k1 2 yıl önce
ebeveyn
işleme
e38168c876
1 değiştirilmiş dosya ile 2 ekleme ve 0 silme
  1. 2 0
      pkg/kubeconfig/loader.go

+ 2 - 0
pkg/kubeconfig/loader.go

@@ -24,6 +24,8 @@ func LoadKubeconfig(path string) (*rest.Config, error) {
 		return nil, fmt.Errorf("loading kubeconfig: %w", err)
 	}
 	config.UserAgent = "opencost"
+	// use protobuf for faster serialization instead of default json
+	// https://kubernetes.io/docs/reference/using-api/api-concepts/#alternate-representations-of-resources
 	config.AcceptContentTypes = "application/vnd.kubernetes.protobuf,application/json"
 	config.ContentType = "application/vnd.kubernetes.protobuf"
 	return config, nil