diff --git a/controllers/operator/nmstate_controller_test.go b/controllers/operator/nmstate_controller_test.go index ab81f47367..3544752813 100644 --- a/controllers/operator/nmstate_controller_test.go +++ b/controllers/operator/nmstate_controller_test.go @@ -487,7 +487,7 @@ var _ = Describe("NMState controller reconcile", func() { ds := &appsv1.DaemonSet{} err := cl.Get(context.Background(), handlerKey, ds) Expect(err).ToNot(HaveOccurred()) - expectedCommand := "nmstatectl show -vv 2>&1" + expectedCommand := "nmstatectl show lo -vv 2>&1" Expect(ds.Spec.Template.Spec.Containers[0].LivenessProbe.Exec.Command).To(ContainElement(expectedCommand)) }) }) @@ -515,7 +515,7 @@ var _ = Describe("NMState controller reconcile", func() { ds := &appsv1.DaemonSet{} err := cl.Get(context.Background(), handlerKey, ds) Expect(err).ToNot(HaveOccurred()) - expectedCommand := "nmstatectl show 2>&1" + expectedCommand := "nmstatectl show lo 2>&1" Expect(ds.Spec.Template.Spec.Containers[0].LivenessProbe.Exec.Command).To(ContainElement(expectedCommand)) }) }) @@ -542,7 +542,7 @@ var _ = Describe("NMState controller reconcile", func() { ds := &appsv1.DaemonSet{} err := cl.Get(context.Background(), handlerKey, ds) Expect(err).ToNot(HaveOccurred()) - expectedCommand := "nmstatectl show 2>&1" + expectedCommand := "nmstatectl show lo 2>&1" Expect(ds.Spec.Template.Spec.Containers[0].LivenessProbe.Exec.Command).To(ContainElement(expectedCommand)) }) }) diff --git a/deploy/handler/operator.yaml b/deploy/handler/operator.yaml index 3fbe3cf2c7..a678acf9ed 100644 --- a/deploy/handler/operator.yaml +++ b/deploy/handler/operator.yaml @@ -437,7 +437,7 @@ spec: command: - bash - -c - - "nmstatectl show {{ .HandlerReadinessProbeExtraArg }} 2>&1" + - "nmstatectl show lo {{ .HandlerReadinessProbeExtraArg }} 2>&1" initialDelaySeconds: 60 periodSeconds: 60 timeoutSeconds: 10 diff --git a/test/e2e/operator/nmstate_install_test.go b/test/e2e/operator/nmstate_install_test.go index f7394044a1..811406c6ad 100644 --- a/test/e2e/operator/nmstate_install_test.go +++ b/test/e2e/operator/nmstate_install_test.go @@ -198,7 +198,7 @@ var _ = Describe("NMState operator", func() { return false } - return slices.Contains(probe.Exec.Command, "nmstatectl show -vv 2>&1") + return slices.Contains(probe.Exec.Command, "nmstatectl show lo -vv 2>&1") }, 60*time.Second, 1*time.Second).Should(BeTrue(), "handler daemonset livenessProbe should use verbose flag") }) AfterEach(func() { @@ -247,10 +247,10 @@ var _ = Describe("NMState operator", func() { } for _, cmd := range probe.Exec.Command { - if cmd == "nmstatectl show -vv 2>&1" { + if cmd == "nmstatectl show lo -vv 2>&1" { return false // Should not have verbose flag in info mode } - if cmd == "nmstatectl show 2>&1" { + if cmd == "nmstatectl show lo 2>&1" { return true // Should have plain nmstatectl show command } } @@ -305,7 +305,7 @@ var _ = Describe("NMState operator", func() { } for _, cmd := range probe.Exec.Command { - if cmd == "nmstatectl show -vv 2>&1" { + if cmd == "nmstatectl show lo -vv 2>&1" { return true } }