11package main
22
33import (
4+ "fmt"
5+
46 "github.com/docker/app/internal"
57 "github.com/docker/app/internal/packager"
68 "github.com/docker/app/internal/renderer"
@@ -9,11 +11,11 @@ import (
911)
1012
1113var (
12- beta1 bool
1314 helmComposeFiles []string
1415 helmSettingsFile []string
1516 helmEnv []string
1617 helmRender bool
18+ stackVersion string
1719)
1820
1921func helmCmd () * cobra.Command {
@@ -32,7 +34,10 @@ func helmCmd() *cobra.Command {
3234 if err != nil {
3335 return err
3436 }
35- return renderer .Helm (appname , helmComposeFiles , helmSettingsFile , d , helmRender , beta1 )
37+ if stackVersion != "v1beta2" && stackVersion != "v1beta1" {
38+ return fmt .Errorf ("invalid stack version %q (accepted values: v1beta1, v1beta2)" , stackVersion )
39+ }
40+ return renderer .Helm (appname , helmComposeFiles , helmSettingsFile , d , helmRender , stackVersion )
3641 },
3742 }
3843 if internal .Experimental == "on" {
@@ -44,6 +49,6 @@ be rendered instead of exported as a template.`
4449 }
4550 cmd .Flags ().StringArrayVarP (& helmSettingsFile , "settings-files" , "f" , []string {}, "Override settings files" )
4651 cmd .Flags ().StringArrayVarP (& helmEnv , "set" , "s" , []string {}, "Override settings values" )
47- cmd .Flags ().BoolVarP ( & beta1 , "beta1 " , "b " , false , "Use an older specification to produce a chart compatible with Docker UCP 2.0 " )
52+ cmd .Flags ().StringVarP ( & stackVersion , "stack-version " , "" , "v1beta2" , "Version of the stack specification for the produced helm chart " )
4853 return cmd
4954}
0 commit comments