mirror of
https://github.com/kubevela/kubevela.git
synced 2026-08-18 03:56:36 +00:00
feat(helm): set User-Agent when downloading Helm repo index.yaml (#7162)
Signed-off-by: goingforstudying-ctrl <goingforstudying@gmail.com> Co-authored-by: goingforstudying-ctrl <goingforstudying@ctrl.com>
This commit is contained in:
co-authored by
goingforstudying-ctrl
parent
24ae77d39f
commit
8598986e4f
@@ -27,6 +27,9 @@ import (
|
||||
"helm.sh/helm/v3/pkg/getter"
|
||||
helmrepo "helm.sh/helm/v3/pkg/repo"
|
||||
"sigs.k8s.io/yaml"
|
||||
|
||||
"github.com/oam-dev/kubevela/apis/types"
|
||||
"github.com/oam-dev/kubevela/version"
|
||||
)
|
||||
|
||||
// IndexYaml is the index.yaml of helm repo
|
||||
@@ -67,9 +70,10 @@ func loadData(u string, cred *RepoCredential) (*bytes.Buffer, error) {
|
||||
}
|
||||
|
||||
indexURL := parsedURL.String()
|
||||
// TODO add user-agent
|
||||
userAgent := types.KubeVelaName + "/" + version.GitRevision
|
||||
g, _ := getter.NewHTTPGetter()
|
||||
resp, err = g.Get(indexURL,
|
||||
getter.WithUserAgent(userAgent),
|
||||
getter.WithTimeout(5*time.Minute),
|
||||
getter.WithURL(u),
|
||||
getter.WithInsecureSkipVerifyTLS(skipTLS),
|
||||
|
||||
Reference in New Issue
Block a user