operator: add missing udev env to discover pod

currently, we're setting the env `DISCOVER_DAEMON_UDEV_BLACKLIST`
in operator.yaml but we're not reading from the operator env and
setting the value to discover pod env.

Signed-off-by: subhamkrai <srai@redhat.com>
(cherry picked from commit 2742a707cc)
This commit is contained in:
subhamkrai authored and Mergify committed 2025-07-08 14:27:48 +00:00
1 parent f24ceb9a48
commit 274caf435f
3 files changed
+4 -3

No files matched your search

+2 -2
View File
@@ -42,7 +42,7 @@ import (
)
const (
discoverDaemonUdev = "DISCOVER_DAEMON_UDEV_BLACKLIST"
DiscoverDaemonUdev = "DISCOVER_DAEMON_UDEV_BLACKLIST"
)
var (
@@ -200,7 +200,7 @@ func udevBlockMonitor(c chan struct{}, period time.Duration) {
// get discoverDaemonUdevBlacklist from the environment variable
// if user doesn't provide any regex; generate the default regex
// else use the regex provided by user
discoverUdev := os.Getenv(discoverDaemonUdev)
discoverUdev := os.Getenv(DiscoverDaemonUdev)
if discoverUdev == "" {
discoverUdev = "(?i)dm-[0-9]+,(?i)rbd[0-9]+,(?i)nbd[0-9]+"
}
+1
View File
@@ -148,6 +148,7 @@ func (d *Discover) createDiscoverDaemonSet(ctx context.Context, namespace, disco
k8sutil.NamespaceEnvVar(),
k8sutil.NodeEnvVar(),
k8sutil.NameEnvVar(),
{Name: discoverDaemon.DiscoverDaemonUdev, Value: os.Getenv(discoverDaemon.DiscoverDaemonUdev)},
},
},
},
+1 -1
View File
@@ -80,7 +80,7 @@ func TestStartDiscoveryDaemonset(t *testing.T) {
volumeMounts := agentDS.Spec.Template.Spec.Containers[0].VolumeMounts
assert.Equal(t, 3, len(volumeMounts))
envs := agentDS.Spec.Template.Spec.Containers[0].Env
assert.Equal(t, 3, len(envs))
assert.Equal(t, 4, len(envs))
image := agentDS.Spec.Template.Spec.Containers[0].Image
assert.Equal(t, "rook/rook:myversion", image)
assert.Nil(t, agentDS.Spec.Template.Spec.Tolerations)