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 {