Updated oci format logic

Signed-off-by: Asir Tamboli <tamboliasir1@gmail.com>
pull/10290/head
Asir Tamboli 3 years ago
parent 02685e94bd
commit ea49d811bf

@ -342,7 +342,7 @@ func (m *Manager) downloadAll(deps []*chart.Dependency) error {
}
version := ""
if strings.HasPrefix(churl, "oci://") {
if registry.IsOCI(churl) {
if !resolver.FeatureGateOCI.IsEnabled() {
return errors.Wrapf(resolver.FeatureGateOCI.Error(),
"the repository %s is an OCI registry", churl)
@ -477,7 +477,7 @@ func (m *Manager) hasAllRepos(deps []*chart.Dependency) error {
Loop:
for _, dd := range deps {
// If repo is from local path or OCI, continue
if strings.HasPrefix(dd.Repository, "file://") || strings.HasPrefix(dd.Repository, "oci://") {
if strings.HasPrefix(dd.Repository, "file://") || registry.IsOCI(dd.Repository) {
continue
}
@ -579,7 +579,7 @@ func (m *Manager) resolveRepoNames(deps []*chart.Dependency) (map[string]string,
for _, dd := range deps {
// Don't map the repository, we don't need to download chart from charts directory
// When OCI is used there is no Helm repository
if dd.Repository == "" || strings.HasPrefix(dd.Repository, "oci://") {
if dd.Repository == "" || registry.IsOCI(dd.Repository) {
continue
}
// if dep chart is from local path, verify the path is valid
@ -595,7 +595,7 @@ func (m *Manager) resolveRepoNames(deps []*chart.Dependency) (map[string]string,
continue
}
if strings.HasPrefix(dd.Repository, "oci://") {
if registry.IsOCI(dd.Repository) {
reposMap[dd.Name] = dd.Repository
continue
}
@ -709,7 +709,7 @@ func (m *Manager) parallelRepoUpdate(repos []*repo.Entry) error {
//
// If it finds a URL that is "relative", it will prepend the repoURL.
func (m *Manager) findChartURL(name, version, repoURL string, repos map[string]*repo.ChartRepository) (url, username, password string, insecureskiptlsverify, passcredentialsall bool, caFile, certFile, keyFile string, err error) {
if strings.HasPrefix(repoURL, "oci://") {
if registry.IsOCI(repoURL) {
return fmt.Sprintf("%s/%s:%s", repoURL, name, version), "", "", false, false, "", "", "", nil
}

Loading…
Cancel
Save