-
Notifications
You must be signed in to change notification settings - Fork 285
Add NatFlags flag to OutboundNatPolicySetting #1013
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,6 +75,12 @@ type SubnetPolicy struct { | |
| // NatFlags are flags for portmappings. | ||
| type NatFlags uint32 | ||
|
|
||
| const ( | ||
| NatFlagsNone NatFlags = iota | ||
| NatFlagsLocalRoutedVip | ||
| NatFlagsIPv6 | ||
| ) | ||
|
|
||
| /// Endpoint Policy objects | ||
|
|
||
| // PortMappingPolicySetting defines Port Mapping (NAT) | ||
|
|
@@ -135,6 +141,7 @@ type OutboundNatPolicySetting struct { | |
| VirtualIP string `json:",omitempty"` | ||
| Exceptions []string `json:",omitempty"` | ||
| Destinations []string `json:",omitempty"` | ||
| Flags NatFlags `json:",omitempty"` | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It appears that the version check for ipv6 support already exists in the form of IPv6DualStackSupported. If more checks need to be added please let me know.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should an enum be defined as well for each value of NatFlags? Right now its just declared as an int: so I did not add one just for ipv6.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I think it's a good idea to define the enum. Something like this |
||
| } | ||
|
|
||
| // SDNRoutePolicySetting sets SDN Route on an Endpoint. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally these would be constants also, is there any reason they aren't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you can do the same as https://github.com/microsoft/hcsshim/pull/1013/files/d3f1ab7aff4da7a2e367a9a05ab5b2c6c919fcca..f568d433f83efc97f2eaecb882ef8e1e79357f23#r623456888 also
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea why they were not made constants in the first place over here :). I would prefer we not change this as these are being used from kubeproxy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking in case anyone knew 😆. Them being constants wouldn't affect anything on them pulling in a new release though, so it should be harmless. They'll be the same type (and value), just not reassignable now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just code hygiene