Skip to content
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

Merged
merged 1 commit into from
Jun 10, 2022
Merged

Conversation

2ez4szliu
Copy link
Collaborator

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)

@vmwclabot
Copy link
Member

@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 Signed-off-by: John Doe <john.doe@email.org> to the last line of each Git commit message. The e-mail address used to sign must match the e-mail address of the Git author. Click here to view the Developer Certificate of Origin agreement.

@@ -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 {
Copy link
Collaborator

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)

Copy link
Collaborator Author

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

@annakhm
Copy link
Collaborator

annakhm commented Jun 3, 2022

/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>
@2ez4szliu 2ez4szliu merged commit 1ba344b into vmware:master Jun 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants