-
Notifications
You must be signed in to change notification settings - Fork 76
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
Fix some issues with NAT #759
Conversation
@2ez4szliu, you must sign every commit in this pull request acknowledging our Developer Certificate of Origin before your changes are merged. This can be done by adding
|
8e8711a
to
24bd9ca
Compare
@@ -345,8 +362,8 @@ func resourceNsxtPolicyNATRuleCreate(d *schema.ResourceData, m interface{}) erro | |||
ruleStruct.TranslatedPorts = &ports | |||
} | |||
|
|||
if len(sNets) > 0 { | |||
ruleStruct.SourceNetwork = &sNets | |||
if sNets != nil && len(*sNets) > 0 { |
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 think since sNets would be nil unless specified, we can move it up into struct initialization, no need for this if (same below)
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.
Done. Also added a test case to test create NO_SNAT with no translated network
/test-all |
(1) When creating REFLEXIVE Nat rules, the destination_network should be set to nil instead of empty string (issue vmware#758) (2) Allow translated_network field to be optional when for no_snat/no_dnat (issue vmware#753) Signed-off-by: Shizhao Liu <lshizhao@vmware.com>
24bd9ca
to
eb8c0f0
Compare
Fix some issues with NAT
(1) When creating REFLEXIVE Nat rules, the destination_network should be set to nil instead of empty string (issue #758)
(2) Allow translated_network field to be optional for no_snat/no_dnat (issue #753)