From 3f544d25edd79132f450af2ef2720ea85a3f7aa4 Mon Sep 17 00:00:00 2001 From: thebsdbox Date: Thu, 2 Nov 2017 18:04:58 +0000 Subject: [PATCH] vSphere Panic Fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes issue #2635 related to no network being passed during an image upload as no network is required. However a hostname is still required due to vCenter handing the upload to a vSphere server and it’s DataStore. Signed-off-by: Dan Finneran --- src/cmd/linuxkit/run_vcenter.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/linuxkit/run_vcenter.go b/src/cmd/linuxkit/run_vcenter.go index b8d39bfb5..b524bd41e 100644 --- a/src/cmd/linuxkit/run_vcenter.go +++ b/src/cmd/linuxkit/run_vcenter.go @@ -199,9 +199,9 @@ func vCenterConnect(ctx context.Context, newVM vmConfig) (*govmomi.Client, *obje log.Fatalln("Error locating default datacenter folder") } - // Check if network connectivity is requested + // This code is shared between Push/Run, a network isn't needed for Pushing an image var net object.NetworkReference - if *newVM.networkName != "" { + if newVM.networkName != nil && *newVM.networkName != "" { net, err = f.NetworkOrDefault(ctx, *newVM.networkName) if err != nil { log.Fatalf("Network [%s], could not be found", *newVM.networkName)