mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
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:
@ -24,7 +24,7 @@ func createNamespace(c kubernetes.Interface, name string) error {
|
||||
}
|
||||
_, err := c.CoreV1().Namespaces().Create(context.TODO(), ns, metav1.CreateOptions{})
|
||||
if err != nil && !apierrs.IsAlreadyExists(err) {
|
||||
return err
|
||||
return fmt.Errorf("failed to create namespace: %w", err)
|
||||
}
|
||||
|
||||
return wait.PollImmediate(poll, timeout, func() (bool, error) {
|
||||
@ -47,7 +47,7 @@ func deleteNamespace(c kubernetes.Interface, name string) error {
|
||||
timeout := time.Duration(deployTimeout) * time.Minute
|
||||
err := c.CoreV1().Namespaces().Delete(context.TODO(), name, metav1.DeleteOptions{})
|
||||
if err != nil && !apierrs.IsNotFound(err) {
|
||||
return err
|
||||
return fmt.Errorf("failed to delete namespace: %w", err)
|
||||
}
|
||||
return wait.PollImmediate(poll, timeout, func() (bool, error) {
|
||||
_, err = c.CoreV1().Namespaces().Get(context.TODO(), name, metav1.GetOptions{})
|
||||
|
Reference in New Issue
Block a user