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 Nov 30, 2023
1 parent 0c288e8 commit 7fd17e8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/charts/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,17 @@ func UpdateHelmMetadataWithDependencies(fs billy.Filesystem, mainHelmChartPath s

// Update the Repository for each dependency
for dependencyName := range dependencyMap {
componentChart, err := helmLoader.Load(filesystem.GetAbsPath(fs, filepath.Join(mainHelmChartPath, fmt.Sprintf("charts/%s", dependencyName))))
if err != nil {
return err
}
componentVersion := componentChart.Metadata.Version

found := false
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
d.Version = componentVersion
found = true
}
}
Expand All @@ -266,7 +272,7 @@ func UpdateHelmMetadataWithDependencies(fs billy.Filesystem, mainHelmChartPath s
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 7fd17e8

Please sign in to comment.