-
Notifications
You must be signed in to change notification settings - Fork 75
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
Add NAT rule handling IDs #216
Conversation
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com> # Conflicts: # CHANGELOG.md # govcd/edgegateway.go # govcd/edgegateway_test.go
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
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.
Round 1 :)
Issue (others inline):
I've started tests: go test -tags functional -check.vv -check.f "Test_.*NAT.*" -timeout=15m .
on an empty edge gateway.
START: api_vcd_test.go:250: TestVCD.SetUpSuite
PASS: api_vcd_test.go:250: TestVCD.SetUpSuite 15.232s
START: edgegateway_test.go:352: TestVCD.Test_AddDNATRule
PASS: edgegateway_test.go:352: TestVCD.Test_AddDNATRule 44.961s
START: edgegateway_test.go:282: TestVCD.Test_AddSNATRule
PASS: edgegateway_test.go:282: TestVCD.Test_AddSNATRule 44.865s
START: edgegateway_test.go:31: TestVCD.Test_NATMapping
PASS: edgegateway_test.go:31: TestVCD.Test_NATMapping 14.136s
START: edgegateway_test.go:77: TestVCD.Test_NATPortMapping
PASS: edgegateway_test.go:77: TestVCD.Test_NATPortMapping 14.119s
START: api_vcd_test.go:787: TestVCD.TearDownSuite
removeLeftoverEntries: [INFO] Attempting cleanup of vapp 'TestSetUpSuite' instantiated by createTestVapp
removeLeftoverEntries: [INFO] Removed vapp 'TestSetUpSuite' created by createTestVapp
PASS: api_vcd_test.go:787: TestVCD.TearDownSuite 0.288s
OK: 4 passed
PASS
ok github.com/vmware/go-vcloud-director/v2/govcd 133.743s
Test_NATPortMapping and Test_NATMapping do this. These two methods use old delete which isn't working correctly in these test cases. Possbile solutions:
|
@Didainius @vbauzysvmware was there resolution for this issue? |
Test_NATPortMapping and Test_NATMapping do this - they are old unit tests. These two test methods use old delete which isn't working correctly in these test cases. Possbile solutions:
|
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
I vote for option 2 and fixing tests. It constantly leaves mess in NAT table and we will not remove it soon. |
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
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.
Some changes required. Will review again after tests
govcd/edgegateway.go
Outdated
// Allows to assign specific network Org VDC or external. Old function AddNATPortMapping and | ||
// AddNATMapping assigns rule to first external network | ||
func (eGW *EdgeGateway) AddDNATRule(ruleDetails NatRule) ([]*types.NatRule, error) { | ||
// AddDNATRule creates DNAT rule and return created NAT struct or error. |
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.
"and return created NAT struct or error" -> "and returns the NAT struct that was created or an error"
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.
Changed
govcd/edgegateway.go
Outdated
// AddNATMapping assigns rule to first external network | ||
func (eGW *EdgeGateway) AddSNATRule(networkHref, externalIP, internalIP, description string) ([]*types.NatRule, error) { | ||
// AddSNATRule creates SNAT rule and returns created NAT rule or error. | ||
// Allows to assign specific Org VDC or external network. |
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.
"to assign" -> "assigning"
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.
fixed
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Changed to use new delete - now clean. |
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
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.
Tests green on 9.5.
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.
LGTM
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.
LGTM!
Ref: https://github.com/terraform-providers/terraform-provider-vcd/issues/244
Previous temporary functions were removed and new functions added to support ID handling. Majorly solves Nat rule removal.