Commit 34f9c67e authored by Sushil Kumar's avatar Sushil Kumar

Shallow copy existing chart details

parent 156d48bc
...@@ -219,7 +219,7 @@ func ProcessRequirementsTags(reqs *Requirements, cvals Values) { ...@@ -219,7 +219,7 @@ func ProcessRequirementsTags(reqs *Requirements, cvals Values) {
} }
func copyChartAsAlias(charts []*chart.Chart, dependentChart, aliasChart string) *chart.Chart { func copyChartAsAlias(charts []*chart.Chart, dependentChart, aliasChart string) *chart.Chart {
var chartFound *chart.Chart var chartFound chart.Chart
for _, existingChart := range charts { for _, existingChart := range charts {
if existingChart == nil { if existingChart == nil {
continue continue
...@@ -231,30 +231,13 @@ func copyChartAsAlias(charts []*chart.Chart, dependentChart, aliasChart string) ...@@ -231,30 +231,13 @@ func copyChartAsAlias(charts []*chart.Chart, dependentChart, aliasChart string)
continue continue
} }
chartFound = new(chart.Chart) chartFound = *existingChart
chartFound.Metadata = &chart.Metadata{ newMetadata := *existingChart.Metadata
Name: aliasChart, newMetadata.Name = aliasChart
Home: existingChart.Metadata.Home, chartFound.Metadata = &newMetadata
Sources: existingChart.Metadata.Sources, return &chartFound
Version: existingChart.Metadata.Version,
Description: existingChart.Metadata.Description,
Keywords: existingChart.Metadata.Keywords,
Maintainers: existingChart.Metadata.Maintainers,
Engine: existingChart.Metadata.Engine,
Icon: existingChart.Metadata.Icon,
ApiVersion: existingChart.Metadata.ApiVersion,
Condition: existingChart.Metadata.Condition,
Tags: existingChart.Metadata.Tags,
AppVersion: existingChart.Metadata.AppVersion,
Deprecated: existingChart.Metadata.Deprecated,
TillerVersion: existingChart.Metadata.TillerVersion,
}
chartFound.Templates = existingChart.Templates
chartFound.Dependencies = existingChart.Dependencies
chartFound.Values = existingChart.Values
chartFound.Files = existingChart.Files
} }
return chartFound return nil
} }
// ProcessRequirementsEnabled removes disabled charts from dependencies // ProcessRequirementsEnabled removes disabled charts from dependencies
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment