separate repository name from chart name

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
pull/5635/head
Matthew Fisher 7 years ago
parent d0e046549f
commit a8d74baf8b
No known key found for this signature in database
GPG Key ID: 92AA783CBAAE8E3B

@ -26,6 +26,8 @@ type Dependency struct {
// //
// This must mach the name in the dependency's Chart.yaml. // This must mach the name in the dependency's Chart.yaml.
Name string `json:"name"` Name string `json:"name"`
// The URL to the OCI registry.
Repository string `json:"repository"`
// Version is the version (range) of this chart. // Version is the version (range) of this chart.
// //
// A lock file will always produce a single version, while a dependency // A lock file will always produce a single version, while a dependency

@ -184,7 +184,7 @@ func (m *Manager) downloadAll(deps []*chart.Dependency) error {
fmt.Fprintf(m.Out, "Downloading %s\n", dep.Name) fmt.Fprintf(m.Out, "Downloading %s\n", dep.Name)
ref, err := repo.ParseNameTag(dep.Name, dep.Version) ref, err := repo.ParseRepoNameTag(dep.Repository, dep.Name, dep.Version)
if err != nil { if err != nil {
saveError = errors.Wrapf(err, "could not parse dependency %q", dep.Name) saveError = errors.Wrapf(err, "could not parse dependency %q", dep.Name)
break break

@ -17,6 +17,8 @@ limitations under the License.
package repo // import "helm.sh/helm/pkg/repo" package repo // import "helm.sh/helm/pkg/repo"
import ( import (
"path"
"github.com/containerd/containerd/reference" "github.com/containerd/containerd/reference"
) )
@ -28,3 +30,12 @@ func ParseNameTag(name, tag string) (reference.Spec, error) {
} }
return reference.Parse(s) return reference.Parse(s)
} }
// ParseRepoNameTag converts a name and a version to a reference
func ParseRepoNameTag(repo, name, tag string) (reference.Spec, error) {
s := path.Join(repo, name)
if tag != "" {
s += ":" + tag
}
return reference.Parse(s)
}

Loading…
Cancel
Save