diff --git a/hack/windows/Clean-AntreaNetwork.ps1 b/hack/windows/Clean-AntreaNetwork.ps1 index 191cea2b6f6..0c13a127306 100644 --- a/hack/windows/Clean-AntreaNetwork.ps1 +++ b/hack/windows/Clean-AntreaNetwork.ps1 @@ -10,7 +10,7 @@ Remove ovsdb-server and ovs-vswitchd services fom the host. The default value is $false. If this argument is set as true, this script would remove the two Windows services from the host. Otherwise, we consider that these services are supposed to be running on the host, so the script would try to recover them if their statuses are - not as expected. + not as expected. The parameter is ignored when OVSRunMode is "container". .PARAMETER OVSRunMode OVS run mode can be if OVS userspace processes were running inside a container in antrea-agent Pod or if OVS userspace processes were running as a Service on host. Default mode is . diff --git a/hack/windows/Prepare-AntreaAgent.ps1 b/hack/windows/Prepare-AntreaAgent.ps1 index baf9d716eed..78eca1ff5fc 100644 --- a/hack/windows/Prepare-AntreaAgent.ps1 +++ b/hack/windows/Prepare-AntreaAgent.ps1 @@ -32,8 +32,12 @@ if ($AntreaHnsNetwork) { } } if ($NeedCleanNetwork) { + $ovsRunMode = "service" + if ($RunOVSServices -eq $false) { + $ovsRunMode = "container" + } Write-Host "Cleaning stale Antrea network resources if they exist..." - & $CleanAntreaNetworkScript + & $CleanAntreaNetworkScript -OVSRunMode $ovsRunMode } # Enure OVS services are running. if ($RunOVSServices -eq $true) {