From 61922b2f0620ac7de25a89ced9accb84925c232c Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Fri, 6 Jul 2018 19:31:04 -0400 Subject: [PATCH] Use default disk type when no VM config zone given --- backend/gce.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/backend/gce.go b/backend/gce.go index 3daa7633d..ad4215d08 100644 --- a/backend/gce.go +++ b/backend/gce.go @@ -911,13 +911,11 @@ func buildGCEImageSelector(selectorType string, cfg *config.ProviderConfig) (ima func (p *gceProvider) buildInstance(ctx gocontext.Context, startAttributes *StartAttributes, imageLink, startupScript string) *compute.Instance { logger := context.LoggerFromContext(ctx).WithField("self", "backend/gce_instance") - var ( - zone *compute.Zone - err error - diskType string - ) + var err error + + zone := p.ic.Zone + diskType := p.ic.DiskType - zone = p.ic.Zone if startAttributes.VMConfig.Zone != "" { zone, err = p.client.Zones.Get(p.projectID, startAttributes.VMConfig.Zone).Context(ctx).Do() if err != nil {