@@ -39,6 +39,13 @@ post-process the serialized yaml to replace all 'template_'-prefixed keys
3939with the appropriate content (value or template)
4040*/
4141
42+ const (
43+ // V1Beta1 is the string identifier for the v1beta1 version of the stack spec
44+ V1Beta1 = "v1beta1"
45+ // V1Beta2 is the string identifier for the v1beta2 version of the stack spec
46+ V1Beta2 = "v1beta2"
47+ )
48+
4249type helmMaintainer struct {
4350 Name string
4451}
@@ -219,7 +226,7 @@ func helmRender(appname string, targetDir string, composeFiles []string, setting
219226 stack = v1beta2.Stack {
220227 TypeMeta : metav1.TypeMeta {
221228 Kind : "stacks.compose.docker.com" ,
222- APIVersion : "v1beta2" ,
229+ APIVersion : V1Beta2 ,
223230 },
224231 ObjectMeta : metav1.ObjectMeta {
225232 Name : internal .AppNameFromDir (appname ),
@@ -234,7 +241,7 @@ func helmRender(appname string, targetDir string, composeFiles []string, setting
234241 stack = v1beta1.Stack {
235242 TypeMeta : metav1.TypeMeta {
236243 Kind : "stacks.compose.docker.com" ,
237- APIVersion : "v1beta1" ,
244+ APIVersion : V1Beta1 ,
238245 },
239246 ObjectMeta : metav1.ObjectMeta {
240247 Name : internal .AppNameFromDir (appname ),
@@ -268,7 +275,7 @@ func makeStack(appname string, targetDir string, data []byte, beta1 bool) error
268275 stack = templatev1beta2.Stack {
269276 TypeMeta : metav1.TypeMeta {
270277 Kind : "stacks.compose.docker.com" ,
271- APIVersion : "v1beta2" ,
278+ APIVersion : V1Beta2 ,
272279 },
273280 ObjectMeta : metav1.ObjectMeta {
274281 Name : internal .AppNameFromDir (appname ),
@@ -284,7 +291,7 @@ func makeStack(appname string, targetDir string, data []byte, beta1 bool) error
284291 stack = v1beta1.Stack {
285292 TypeMeta : metav1.TypeMeta {
286293 Kind : "stacks.compose.docker.com" ,
287- APIVersion : "v1beta1" ,
294+ APIVersion : V1Beta1 ,
288295 },
289296 ObjectMeta : metav1.ObjectMeta {
290297 Name : internal .AppNameFromDir (appname ),
@@ -318,7 +325,7 @@ func makeStack(appname string, targetDir string, data []byte, beta1 bool) error
318325// Helm renders an app as an Helm Chart
319326func Helm (appname string , composeFiles []string , settingsFile []string , env map [string ]string , render bool , stackVersion string ) error {
320327 targetDir := internal .AppNameFromDir (appname ) + ".chart"
321- beta1 := stackVersion == "v1beta1"
328+ beta1 := stackVersion == V1Beta1
322329 if err := os .Mkdir (targetDir , 0755 ); err != nil && ! os .IsExist (err ) {
323330 return errors .Wrap (err , "failed to create Chart directory" )
324331 }
0 commit comments