瀏覽代碼

add comment

Signed-off-by: r2k1 <yokree@gmail.com>
r2k1 2 年之前
父節點
當前提交
e38168c876
共有 1 個文件被更改,包括 2 次插入0 次删除
  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