Skip to content

Commit

Permalink
Do not remove dependencies versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristian-ZH committed Oct 13, 2023
1 parent 0c288e8 commit dea901e
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 dea901e

Please sign in to comment.