From 851ff67cb3a49d80949006035e3c61b379f40076 Mon Sep 17 00:00:00 2001 From: Stoyan Rachev Date: Wed, 12 Aug 2020 19:31:21 +0300 Subject: [PATCH] Don't wrap errors from unexported methods in core.go --- pkg/kubevirt/core/core.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/kubevirt/core/core.go b/pkg/kubevirt/core/core.go index 9f59d2f..6b14b21 100644 --- a/pkg/kubevirt/core/core.go +++ b/pkg/kubevirt/core/core.go @@ -217,7 +217,7 @@ func (p PluginSPIImpl) DeleteMachine(ctx context.Context, machineName, providerI klog.V(2).Infof("skip virtualMachine evicting, virtualMachine instance %s is not found", machineName) return "", nil } - return "", fmt.Errorf("failed to get virtualMachine: %v", err) + return "", err } if err := client.IgnoreNotFound(c.Delete(ctx, virtualMachine)); err != nil { @@ -300,7 +300,7 @@ func (p PluginSPIImpl) listVMs(ctx context.Context, secret *corev1.Secret) (map[ func (p PluginSPIImpl) machineProviderID(ctx context.Context, secret *corev1.Secret, virtualMachineName, namespace string) (string, error) { virtualMachine, err := p.getVM(ctx, secret, virtualMachineName, namespace) if err != nil { - return "", fmt.Errorf("failed to get virtualMachine: %v", err) + return "", err } return encodeProviderID(string(virtualMachine.UID)), nil