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 ac1b90f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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
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 ac1b90f

Please sign in to comment.