diff --git a/connectivity/check/check.go b/connectivity/check/check.go index 1c214c9769..ac80724d11 100644 --- a/connectivity/check/check.go +++ b/connectivity/check/check.go @@ -68,7 +68,7 @@ type Parameters struct { ConnDisruptTestSetup bool ConnDisruptTestRestartsPath string ConnDisruptTestXfrmErrorsPath string - ConnDisruptDispatchInterval uint + ConnDisruptDispatchInterval time.Duration FlushCT bool SecondaryNetworkIface string diff --git a/connectivity/check/deployment.go b/connectivity/check/deployment.go index b8daa697cd..21ea072660 100644 --- a/connectivity/check/deployment.go +++ b/connectivity/check/deployment.go @@ -672,7 +672,7 @@ func (ct *ConnectivityTest) deploy(ctx context.Context) error { Port: 8000, Command: []string{ "tcd-client", - "--dispatch-interval", strconv.Itoa(int(ct.params.ConnDisruptDispatchInterval)), + "--dispatch-interval", strconv.Itoa(int(ct.params.ConnDisruptDispatchInterval.Milliseconds())), fmt.Sprintf("test-conn-disrupt.%s.svc.cluster.local.:8000", ct.params.TestNamespace), }, ReadinessProbe: readinessProbe, diff --git a/internal/cli/cmd/connectivity.go b/internal/cli/cmd/connectivity.go index c3788385f1..9eba5bff23 100644 --- a/internal/cli/cmd/connectivity.go +++ b/internal/cli/cmd/connectivity.go @@ -178,7 +178,7 @@ func newCmdConnectivityTest(hooks Hooks) *cobra.Command { cmd.Flags().BoolVar(¶ms.ConnDisruptTestSetup, "conn-disrupt-test-setup", false, "Set up conn disrupt test dependencies") cmd.Flags().StringVar(¶ms.ConnDisruptTestRestartsPath, "conn-disrupt-test-restarts-path", "/tmp/cilium-conn-disrupt-restarts", "Conn disrupt test temporary result file (used internally)") cmd.Flags().StringVar(¶ms.ConnDisruptTestXfrmErrorsPath, "conn-disrupt-test-xfrm-errors-path", "/tmp/cilium-conn-disrupt-xfrm-errors", "Conn disrupt test temporary result file (used internally)") - cmd.Flags().UintVar(¶ms.ConnDisruptDispatchInterval, "conn-disrupt-dispatch-interval (ms)", 10, "TCP packet dispatch interval in ms") + cmd.Flags().DurationVar(¶ms.ConnDisruptDispatchInterval, "conn-disrupt-dispatch-interval", 10*time.Millisecond, "TCP packet dispatch interval") cmd.Flags().BoolVar(¶ms.FlushCT, "flush-ct", false, "Flush conntrack of Cilium on each node") cmd.Flags().MarkHidden("flush-ct") cmd.Flags().StringVar(¶ms.SecondaryNetworkIface, "secondary-network-iface", "", "Secondary network iface name (e.g., to test NodePort BPF on multiple networks)")