replace errors.New(fmt.Sprintf()) with fmt.Errorf()

This commit is contained in:
danielqsj 2019-05-05 17:48:20 +08:00
parent c516bb51e3
commit ed9a3fae8e

View File

@ -609,7 +609,7 @@ func (vs *VSphere) getVSphereInstanceForServer(vcServer string, ctx context.Cont
vsphereIns, ok := vs.vsphereInstanceMap[vcServer] vsphereIns, ok := vs.vsphereInstanceMap[vcServer]
if !ok { if !ok {
klog.Errorf("cannot find vcServer %q in cache. VC not found!!!", vcServer) klog.Errorf("cannot find vcServer %q in cache. VC not found!!!", vcServer)
return nil, errors.New(fmt.Sprintf("Cannot find node %q in vsphere configuration map", vcServer)) return nil, fmt.Errorf("cannot find node %q in vsphere configuration map", vcServer)
} }
// Ensure client is logged in and session is valid // Ensure client is logged in and session is valid
err := vs.nodeManager.vcConnect(ctx, vsphereIns) err := vs.nodeManager.vcConnect(ctx, vsphereIns)