Skip to content

Commit

Permalink
Ensure that --build-values does not affect package output
Browse files Browse the repository at this point in the history
Signed-off-by: Soumik Majumder <soumikm@vmware.com>
  • Loading branch information
100mik committed Aug 23, 2023
1 parent 60a80de commit d046d26
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cli/pkg/kctrl/cmd/app/release/app_spec_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func (b *AppSpecBuilder) Build() (kcv1alpha1.AppSpec, error) {
Git: &kcv1alpha1.AppFetchGit{},
},
},
Template: b.opts.BuildTemplate,
Template: b.deepCopyAppTemplateList(b.opts.BuildTemplate),
Deploy: b.opts.BuildDeploy,
},
}
Expand Down Expand Up @@ -169,3 +169,12 @@ func (b *AppSpecBuilder) checkForErrorsAfterReconciliation(app kcv1alpha1.App, f
}
return nil
}

func (b *AppSpecBuilder) deepCopyAppTemplateList(src []kcv1alpha1.AppTemplate) []kcv1alpha1.AppTemplate {
copy := []kcv1alpha1.AppTemplate{}
for _, templateStep := range src {
templateStepCopy := templateStep.DeepCopy()
copy = append(copy, *templateStepCopy)
}
return copy
}

0 comments on commit d046d26

Please sign in to comment.