|
|
|
@ -57,6 +57,11 @@ func (r *Resolver) Resolve(reqs []*chart.Dependency, repoNames map[string]string
|
|
|
|
|
locked := make([]*chart.Dependency, len(reqs))
|
|
|
|
|
missing := []string{}
|
|
|
|
|
for i, d := range reqs {
|
|
|
|
|
constraint, err := semver.NewConstraint(d.Version)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, errors.Wrapf(err, "dependency %q has an invalid version/constraint format", d.Name)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if d.Repository == "" {
|
|
|
|
|
// Local chart subfolder
|
|
|
|
|
if _, err := GetLocalPath(filepath.Join("charts", d.Name), r.chartpath); err != nil {
|
|
|
|
@ -77,13 +82,22 @@ func (r *Resolver) Resolve(reqs []*chart.Dependency, repoNames map[string]string
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// The version of the chart locked will be the version of the chart
|
|
|
|
|
// currently listed in the file system within the chart.
|
|
|
|
|
ch, err := loader.LoadDir(chartpath)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
v, err := semver.NewVersion(ch.Metadata.Version)
|
|
|
|
|
if err != nil {
|
|
|
|
|
// Not a legit entry.
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if !constraint.Check(v) {
|
|
|
|
|
missing = append(missing, d.Name)
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
locked[i] = &chart.Dependency{
|
|
|
|
|
Name: d.Name,
|
|
|
|
|
Repository: d.Repository,
|
|
|
|
@ -92,11 +106,6 @@ func (r *Resolver) Resolve(reqs []*chart.Dependency, repoNames map[string]string
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
constraint, err := semver.NewConstraint(d.Version)
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, errors.Wrapf(err, "dependency %q has an invalid version/constraint format", d.Name)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
repoName := repoNames[d.Name]
|
|
|
|
|
// if the repository was not defined, but the dependency defines a repository url, bypass the cache
|
|
|
|
|
if repoName == "" && d.Repository != "" {
|
|
|
|
|