diff --git a/pkg/operator/discover/discover.go b/pkg/operator/discover/discover.go index 630ecc3e6..1981fc8f1 100644 --- a/pkg/operator/discover/discover.go +++ b/pkg/operator/discover/discover.go @@ -32,7 +32,7 @@ import ( discoverDaemon "github.com/rook/rook/pkg/daemon/discover" "github.com/rook/rook/pkg/operator/ceph/controller" opcontroller "github.com/rook/rook/pkg/operator/ceph/controller" - k8sutil "github.com/rook/rook/pkg/operator/k8sutil" + "github.com/rook/rook/pkg/operator/k8sutil" "github.com/rook/rook/pkg/util/sys" apps "k8s.io/api/apps/v1" @@ -424,7 +424,7 @@ func GetAvailableDevices(ctx context.Context, clusterdContext *clusterd.Context, } } } - } else if len(filter) >= 0 { + } else if len(filter) > 0 { for i := range nodeDevices { // TODO support filter based on other keys matched, err := regexp.Match(filter, []byte(nodeDevices[i].Name)) diff --git a/pkg/operator/k8sutil/pod.go b/pkg/operator/k8sutil/pod.go index 1b2952458..bec194178 100644 --- a/pkg/operator/k8sutil/pod.go +++ b/pkg/operator/k8sutil/pod.go @@ -165,7 +165,7 @@ func GetRunningPod(ctx context.Context, clientset kubernetes.Interface) (*v1.Pod return nil, fmt.Errorf("cannot detect the pod name. Please provide it using the downward API in the manifest file") } podNamespace := os.Getenv(PodNamespaceEnvVar) - if podName == "" { + if podNamespace == "" { return nil, fmt.Errorf("cannot detect the pod namespace. Please provide it using the downward API in the manifest file") }