core: use filter only if its set to non empty string
Also check for the empty namespace instead of an
empty name which was incorrect.
Co-authored-by: Nikita Sivukhin <sivukhin@turso.tech>
Signed-off-by: Travis Nielsen <tnielsen@redhat.com>
(cherry picked from commit 71a4fce87b)
This commit is contained in:
1 parent
88a12084d0
commit
962b995196
2 files changed
+3
-3
No files matched your search
@@ -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))
|
||||
|
||||
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user