From 52811375d1d92e796eac5643d31ded3728b8e951 Mon Sep 17 00:00:00 2001 From: dagnello Date: Fri, 13 May 2016 22:18:55 -0700 Subject: [PATCH] Adding error check when read instance id failed --- pkg/cloudprovider/providers/vsphere/vsphere.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/cloudprovider/providers/vsphere/vsphere.go b/pkg/cloudprovider/providers/vsphere/vsphere.go index 0dc5f103797..486a6ecffd1 100644 --- a/pkg/cloudprovider/providers/vsphere/vsphere.go +++ b/pkg/cloudprovider/providers/vsphere/vsphere.go @@ -94,6 +94,9 @@ func readInstanceID(cfg *VSphereConfig) (string, error) { if err != nil { return "", err } + if out.Len() == 0 { + return "", fmt.Errorf("unable to retrieve Instance ID") + } // Create context ctx, cancel := context.WithCancel(context.Background())