Skip to content

Commit

Permalink
Merge pull request #1 from Kristian-ZH/cherry-pick-do-not-remove-vers…
Browse files Browse the repository at this point in the history
…ions

Do not remove dependencies versions
  • Loading branch information
Kristian-ZH authored Oct 17, 2023
2 parents 3dd99c1 + d117227 commit e8c872a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/charts/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,21 @@ func UpdateHelmMetadataWithDependencies(fs billy.Filesystem, mainHelmChartPath s
for _, d := range chart.Metadata.Dependencies {
if d.Name == dependencyName {
d.Repository = fmt.Sprintf("file://./charts/%s", dependencyName)
d.Version = "" // Local chart archives don't need a version
found = true
}
}
if !found {
componentChart, err := helmLoader.Load(filesystem.GetAbsPath(fs, fmt.Sprintf("../%s/charts", dependencyName)))
if err != nil {
return err
}
componentVersion := componentChart.Metadata.Version

// Dependency does not exist, so we add it to the list
d := &helmChart.Dependency{
Name: dependencyName,
Condition: fmt.Sprintf("%s.enabled", dependencyName),
Version: "", // Local chart archives don't need a version
Version: componentVersion,
Repository: fmt.Sprintf("file://./charts/%s", dependencyName),
}
chart.Metadata.Dependencies = append(chart.Metadata.Dependencies, d)
Expand Down

0 comments on commit e8c872a

Please sign in to comment.