Describe the bug
When deploying Antrea, it will wipe out the Windows system path variable and effectively reset it to the default.
To Reproduce
- Modify system
$PATH (e.g. through an Ansible script or Prepare-Node.ps1 when installing Kubernetes)
- Deploy
antrea-windows-with-ovs.yml as per docs
Expected
If $env:PATH is modified, it must not erase my existing customisations
Actual behavior
System PATH (outside of container) is set to:
C:\Windows\system32;C:\Windows;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\wbem;C:\hpc\;C:\WINDOWS\System32\Wbem;C:\openvswitch\usr\bin
This appears to be due to Install-OVS.ps1 line 101 writing $env:PATH back to the system variable, which appears to be a minimal path value provided by the container, not the $env:PATH value from the host.
This approach (of writing back $env:PATH) is wrong in and of itself, because $env:PATH will include the user's path, which then gets merged into the system path.
Versions:
Kubernetes v1.33
Antrea 2.6.1
CNIplugins 1.6.2
Microsoft CNI plugins 0.3.1
containerd 2.3.1
nerdctl 2.3.1
Additional context
Describe the bug
When deploying Antrea, it will wipe out the Windows system path variable and effectively reset it to the default.
To Reproduce
$PATH(e.g. through an Ansible script orPrepare-Node.ps1when installing Kubernetes)antrea-windows-with-ovs.ymlas per docsExpected
If
$env:PATHis modified, it must not erase my existing customisationsActual behavior
System
PATH(outside of container) is set to:This appears to be due to Install-OVS.ps1 line 101 writing
$env:PATHback to the system variable, which appears to be a minimal path value provided by the container, not the$env:PATHvalue from the host.This approach (of writing back
$env:PATH) is wrong in and of itself, because$env:PATHwill include the user's path, which then gets merged into the system path.Versions:
Kubernetes v1.33
Antrea 2.6.1
CNIplugins 1.6.2
Microsoft CNI plugins 0.3.1
containerd 2.3.1
nerdctl 2.3.1
Additional context