From e0e6908d3f2d23942f7f3da7e86d2415fa8a2cd1 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 28 Sep 2017 11:52:23 +0200 Subject: vm/gce: fix GCE image check --- vm/gce/gce.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'vm') diff --git a/vm/gce/gce.go b/vm/gce/gce.go index bc1a7ac3c..59d33cbc3 100644 --- a/vm/gce/gce.go +++ b/vm/gce/gce.go @@ -67,9 +67,6 @@ func ctor(env *vmimpl.Env) (vmimpl.Pool, error) { if env.Name == "" { return nil, fmt.Errorf("config param name is empty (required for GCE)") } - if env.Image == "" { - return nil, fmt.Errorf("config param image is empty (required for GCE)") - } cfg := &Config{ Count: 1, } @@ -88,6 +85,9 @@ func ctor(env *vmimpl.Env) (vmimpl.Pool, error) { if cfg.GCE_Image == "" && cfg.GCS_Path == "" { return nil, fmt.Errorf("gcs_path parameter is empty") } + if cfg.GCE_Image == "" && env.Image == "" { + return nil, fmt.Errorf("config param image is empty (required for GCE)") + } if cfg.GCE_Image != "" && env.Image != "" { return nil, fmt.Errorf("both image and gce_image are specified") } -- cgit mrf-deployment