Merge pull request #5656 from jaxels10/main

fix: #5654 by checking if both --chart and --chart-ref are set
main
Matheus Pimenta 3 days ago committed by GitHub
commit 94e9af6b2a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -182,6 +182,10 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
return fmt.Errorf("chart or chart-ref is required") return fmt.Errorf("chart or chart-ref is required")
} }
if helmReleaseArgs.chart != "" && helmReleaseArgs.chartRef != "" {
return fmt.Errorf("cannot use --chart in combination with --chart-ref")
}
sourceLabels, err := parseLabels() sourceLabels, err := parseLabels()
if err != nil { if err != nil {
return err return err

@ -42,6 +42,11 @@ func TestCreateHelmRelease(t *testing.T) {
args: "create helmrelease podinfo --export", args: "create helmrelease podinfo --export",
assert: assertError("chart or chart-ref is required"), assert: assertError("chart or chart-ref is required"),
}, },
{
name: "chart and chartRef used in combination",
args: "create helmrelease podinfo --chart podinfo --chart-ref foobar/podinfo --export",
assert: assertError("cannot use --chart in combination with --chart-ref"),
},
{ {
name: "unknown source kind", name: "unknown source kind",
args: "create helmrelease podinfo --source foobar/podinfo --chart podinfo --export", args: "create helmrelease podinfo --source foobar/podinfo --chart podinfo --export",

Loading…
Cancel
Save