Skip to content

Commit

Permalink
Fix Windows AddNodePort parameter error
Browse files Browse the repository at this point in the history
Use VirtualNodePortDNATIPv4 to replace VirtualServiceIPv4.

Signed-off-by: Shuyang Xin <[email protected]>
  • Loading branch information
XinShuYang committed Aug 16, 2022
1 parent 173ef52 commit b2102f2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/agent/route/route_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ func (c *Client) DeleteSNATRule(mark uint32) error {

// TODO: nodePortAddresses is not supported currently.
func (c *Client) AddNodePort(nodePortAddresses []net.IP, port uint16, protocol binding.Protocol) error {
return util.ReplaceNetNatStaticMapping(antreaNatNodePort, "0.0.0.0", port, config.VirtualServiceIPv4.String(), port, string(protocol))
return util.ReplaceNetNatStaticMapping(antreaNatNodePort, "0.0.0.0", port, config.VirtualNodePortDNATIPv4.String(), port, string(protocol))
}

func (c *Client) DeleteNodePort(nodePortAddresses []net.IP, port uint16, protocol binding.Protocol) error {
Expand Down
3 changes: 3 additions & 0 deletions test/e2e/connectivity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ func TestConnectivity(t *testing.T) {
skipIfNumNodesLessThan(t, 2)
testPingLargeMTU(t, data)
})
if len(clusterInfo.windowsNodes) != 0 {
time.Sleep(30 * time.Second)
}
}

func waitForPodIPs(t *testing.T, data *TestData, podInfos []podInfo) map[string]*PodIPs {
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const (
mcjoinImage = "projects.registry.vmware.com/antrea/mcjoin:v2.9"
netshootImage = "projects.registry.vmware.com/antrea/netshoot:v0.1"
nginxImage = "projects.registry.vmware.com/antrea/nginx:1.21.6-alpine"
iisImage = "mcr.microsoft.com/windows/servercore/iis"
iisImage = "mcr.microsoft.com/windows/servercore/iis:latest"
perftoolImage = "projects.registry.vmware.com/antrea/perftool"
ipfixCollectorImage = "projects.registry.vmware.com/antrea/ipfix-collector:v0.5.12"
ipfixCollectorPort = "4739"
Expand Down
1 change: 1 addition & 0 deletions test/e2e/nodeportlocal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ func NPLTestMultiplePods(t *testing.T, data *TestData) {
node := nodeName(0)
workerNode := node
if len(clusterInfo.windowsNodes) != 0 {
time.Sleep(10 * time.Second)
workerNode = workerNodeName(clusterInfo.windowsNodes[0])
}
testData.createNginxClusterIPServiceWithAnnotations(workerNode, false, &ipFamily, annotation)
Expand Down

0 comments on commit b2102f2

Please sign in to comment.