From ed9a3fae8e2ce2b14853db5a8858db5695aae80c Mon Sep 17 00:00:00 2001 From: danielqsj Date: Sun, 5 May 2019 17:48:20 +0800 Subject: [PATCH] replace errors.New(fmt.Sprintf()) with fmt.Errorf() --- staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go index f6946f15941..4374405582f 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go +++ b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere.go @@ -609,7 +609,7 @@ func (vs *VSphere) getVSphereInstanceForServer(vcServer string, ctx context.Cont vsphereIns, ok := vs.vsphereInstanceMap[vcServer] if !ok { 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 err := vs.nodeManager.vcConnect(ctx, vsphereIns)