[release-4.1] feat: Adapt to oci-based helmchart repo (#6203)

* add oci client for registry

* add LoadRepoIndexFormOci

* feat: Adapt to oci-based helmchart repo

* Update the golang base image version in the dockerfile

* update oci_test.go

Signed-off-by: lingbo <lingbo@lingbohome.com>

* fix: Update oci_test.go

Signed-off-by: 凌波 <lingbo@lingbohome.com>

* Update go imports

---------

Signed-off-by: lingbo <lingbo@lingbohome.com>
Signed-off-by: 凌波 <lingbo@lingbohome.com>
Co-authored-by: lingbo <lingbo@lingbohome.com>
Co-authored-by: hongming <coder.scala@gmail.com>
This commit is contained in:
KubeSphere CI Bot
2024-09-25 11:02:16 +08:00
committed by GitHub
parent 88db498bcd
commit 7e703750e8
12 changed files with 727 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ import (
"errors"
"fmt"
"helm.sh/helm/v3/pkg/registry"
"k8s.io/klog/v2"
"io"
@@ -145,6 +146,9 @@ func DownLoadChart(cli runtimeclient.Client, pullUrl, repoName string) (data []b
klog.Errorf("failed to get app repo, err: %v", err)
return data, err
}
if registry.IsOCI(pullUrl) {
return HelmPullFromOci(pullUrl, repo.Spec.Credential)
}
buf, err := HelmPull(pullUrl, repo.Spec.Credential)
if err != nil {
klog.Errorf("load chart failed, error: %s", err)