@@ -87,7 +87,7 @@ func NewK8sClient(ns string) (*K8sClient, error) {
8787 if err != nil {
8888 return nil , errors .Wrap (err , "failed to build OpenEBS clientset" )
8989 }
90- lv , err := getLVMclient (config )
90+ lv , _ := getLVMclient (config )
9191 return & K8sClient {
9292 Ns : ns ,
9393 K8sCS : k8sCS ,
@@ -222,7 +222,7 @@ func (k K8sClient) GetPVs(volNames []string, labelselector string) (*corev1.Pers
222222 volMap [vol .Name ] = vol
223223 }
224224 var list []corev1.PersistentVolume
225- if volNames == nil || len (volNames ) == 0 {
225+ if len (volNames ) == 0 {
226226 return pvs , nil
227227 }
228228 for _ , name := range volNames {
@@ -256,7 +256,7 @@ func (k K8sClient) GetPVCs(namespace string, pvcNames []string, labelselector st
256256 if err != nil {
257257 return nil , err
258258 }
259- if pvcNames == nil || len (pvcNames ) == 0 {
259+ if len (pvcNames ) == 0 {
260260 return pvcs , nil
261261 }
262262 pvcNamePVCmap := make (map [string ]corev1.PersistentVolumeClaim )
@@ -296,7 +296,7 @@ func (k K8sClient) GetBDs(bdNames []string, labelselector string) (*v1alpha1.Blo
296296 if err != nil {
297297 return nil , errors .Wrapf (err , "Error while getting block device" )
298298 }
299- if bdNames == nil || len (bdNames ) == 0 {
299+ if len (bdNames ) == 0 {
300300 return bds , nil
301301 }
302302 bdNameBDmap := make (map [string ]v1alpha1.BlockDevice )
@@ -340,7 +340,7 @@ func (k K8sClient) GetCVs(volNames []string, rType util.ReturnType, labelSelecto
340340 return nil , nil , errors .Wrapf (err , "Error while getting volumes" )
341341 }
342342 var list []cstorv1.CStorVolume
343- if volNames == nil || len (volNames ) == 0 {
343+ if len (volNames ) == 0 {
344344 list = cVols .Items
345345 } else {
346346 csMap := make (map [string ]cstorv1.CStorVolume )
@@ -539,7 +539,7 @@ func (k K8sClient) GetCSPIs(cspiNames []string, labelselector string) (*cstorv1.
539539 if err != nil {
540540 return nil , errors .Wrapf (err , "Error while getting cspi" )
541541 }
542- if cspiNames == nil || len (cspiNames ) == 0 {
542+ if len (cspiNames ) == 0 {
543543 return cspi , nil
544544 }
545545 poolMap := make (map [string ]cstorv1.CStorPoolInstance )
@@ -590,7 +590,7 @@ func (k K8sClient) GetJVs(volNames []string, rType util.ReturnType, labelSelecto
590590 return nil , nil , err
591591 }
592592 var list []jiva.JivaVolume
593- if volNames == nil || len (volNames ) == 0 {
593+ if len (volNames ) == 0 {
594594 list = jvs .Items
595595 } else {
596596 jvsMap := make (map [string ]jiva.JivaVolume )
@@ -653,7 +653,7 @@ func (k K8sClient) GetZFSVols(volNames []string, rType util.ReturnType, labelSel
653653 return nil , nil , err
654654 }
655655 var list []zfs.ZFSVolume
656- if volNames == nil || len (volNames ) == 0 {
656+ if len (volNames ) == 0 {
657657 list = zvols .Items
658658 } else {
659659 zvsMap := make (map [string ]zfs.ZFSVolume )
0 commit comments