From c0acaa74c3377624b44373e50de27115e3a39a13 Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 26 Mar 2018 12:25:16 -0700 Subject: [PATCH] Fixes the issue #559 with env versions (#569) Do not set automatically set env version if user has already specified it. --- fission/environment.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fission/environment.go b/fission/environment.go index 483d7396..e9085d12 100644 --- a/fission/environment.go +++ b/fission/environment.go @@ -57,20 +57,22 @@ func envCreate(c *cli.Context) error { envExternalNetwork := c.Bool("externalnetwork") if len(envBuilderImg) > 0 { - envVersion = 2 + if !c.IsSet("version") { + envVersion = 2 + } if len(envBuildCmd) == 0 { envBuildCmd = "build" } } - resourceReq := getResourceReq(c) - // Environment API interface version is not specified and // builder image is empty, set default interface version if envVersion == 0 { envVersion = 1 } + resourceReq := getResourceReq(c) + env := &crd.Environment{ Metadata: metav1.ObjectMeta{ Name: envName,