Skip to content

Commit

Permalink
Fix Lint - Addr. comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jpayne3506 committed Apr 20, 2023
1 parent c371e77 commit f72a741
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion cni/network/network_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,14 @@ func getPoliciesFromRuntimeCfg(nwCfg *cni.NetworkConfig) []policy.Policy {
protocol = policy.ProtocolUdp
}

// To support hostport policy mapping
// uint32 NatFlagsLocalRoutedVip = 1
rawPolicy, _ := json.Marshal(&hnsv2.PortMappingPolicySetting{
ExternalPort: uint16(mapping.HostPort),
InternalPort: uint16(mapping.ContainerPort),
VIP: mapping.HostIp,
Protocol: protocol,
Flags: hnsv2.NatFlagsLocalRoutedVip, // iota'd, NatFlagsLocalRoutedVip = 1, uint32
Flags: hnsv2.NatFlagsLocalRoutedVip,
})

hnsv2Policy, _ := json.Marshal(&hnsv2.EndpointPolicy{
Expand Down
8 changes: 4 additions & 4 deletions cni/network/network_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ func TestSetPoliciesFromNwCfg(t *testing.T) {
HostPort: 44000,
ContainerPort: 80,
},
},
},
},
}
},
},
},
},
}
for _, tt := range tests {
tt := tt
Expand Down

0 comments on commit f72a741

Please sign in to comment.