|
|
@ -141,8 +141,17 @@ func Save(c *chart.Chart, outDir string) (string, error) {
|
|
|
|
func writeTarContents(out *tar.Writer, c *chart.Chart, prefix string) error {
|
|
|
|
func writeTarContents(out *tar.Writer, c *chart.Chart, prefix string) error {
|
|
|
|
base := filepath.Join(prefix, c.Name())
|
|
|
|
base := filepath.Join(prefix, c.Name())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Pull out the dependencies of a v1 Chart, since there's no way
|
|
|
|
|
|
|
|
// to tell the serialiser to skip a field for just this use case
|
|
|
|
|
|
|
|
savedDependencies := c.Metadata.Dependencies
|
|
|
|
|
|
|
|
if c.Metadata.APIVersion == chart.APIVersionV1 {
|
|
|
|
|
|
|
|
c.Metadata.Dependencies = nil
|
|
|
|
|
|
|
|
}
|
|
|
|
// Save Chart.yaml
|
|
|
|
// Save Chart.yaml
|
|
|
|
cdata, err := yaml.Marshal(c.Metadata)
|
|
|
|
cdata, err := yaml.Marshal(c.Metadata)
|
|
|
|
|
|
|
|
if c.Metadata.APIVersion == chart.APIVersionV1 {
|
|
|
|
|
|
|
|
c.Metadata.Dependencies = savedDependencies
|
|
|
|
|
|
|
|
}
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|