Fixes the issue #559 with env versions (#569)

Do not set automatically set env version if user has already specified it.
This commit is contained in:
Vishal
2018-03-26 12:25:16 -07:00
committed by Soam Vasani
parent 8708fdec93
commit c0acaa74c3
+5 -3
View File
@@ -57,20 +57,22 @@ func envCreate(c *cli.Context) error {
envExternalNetwork := c.Bool("externalnetwork") envExternalNetwork := c.Bool("externalnetwork")
if len(envBuilderImg) > 0 { if len(envBuilderImg) > 0 {
envVersion = 2 if !c.IsSet("version") {
envVersion = 2
}
if len(envBuildCmd) == 0 { if len(envBuildCmd) == 0 {
envBuildCmd = "build" envBuildCmd = "build"
} }
} }
resourceReq := getResourceReq(c)
// Environment API interface version is not specified and // Environment API interface version is not specified and
// builder image is empty, set default interface version // builder image is empty, set default interface version
if envVersion == 0 { if envVersion == 0 {
envVersion = 1 envVersion = 1
} }
resourceReq := getResourceReq(c)
env := &crd.Environment{ env := &crd.Environment{
Metadata: metav1.ObjectMeta{ Metadata: metav1.ObjectMeta{
Name: envName, Name: envName,