cleanup: Modifies Wrapcheck linter

Wrapcheck is a  simple Go linter to check that errors
from external packages are wrapped during return to
help identify the error source during debugging.
This commit addresses the wrapcheck error

Updates:#2025

Signed-off-by: Yati Padia <ypadia@redhat.com>
This commit is contained in:
Yati Padia
2021-05-11 14:58:56 +05:30
committed by mergify[bot]
parent 591ba3f580
commit 847b996501
14 changed files with 72 additions and 57 deletions

View File

@ -68,7 +68,7 @@ func createConfigMap(pluginPath string, c kubernetes.Interface, f *framework.Fra
if err == nil {
_, updateErr := c.CoreV1().ConfigMaps(cephCSINamespace).Update(context.TODO(), &cm, metav1.UpdateOptions{})
if updateErr != nil {
return updateErr
return fmt.Errorf("failed to update configmap: %w", updateErr)
}
}
if apierrs.IsNotFound(err) {
@ -116,5 +116,8 @@ func createCustomConfigMap(c kubernetes.Interface, pluginPath string, subvolgrpI
cm.Namespace = cephCSINamespace
// since a configmap is already created, update the existing configmap
_, err = c.CoreV1().ConfigMaps(cephCSINamespace).Update(context.TODO(), &cm, metav1.UpdateOptions{})
return err
if err != nil {
return fmt.Errorf("failed to update configmap: %w", err)
}
return nil
}