-
Notifications
You must be signed in to change notification settings - Fork 112
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
NAT rule support IDs and external or Org networks #282
Conversation
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]> # Conflicts: # vcd/resource_vcd_org_vdc.go
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
…roviders/terraform-provider-vcd into vdc-metadata
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]> # Conflicts: # CHANGELOG.md # go.mod # go.sum # vendor/github.com/vmware/go-vcloud-director/v2/govcd/edgegateway.go # vendor/modules.txt
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
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
vcd/resource_vcd_dnat.go
Outdated
if externalNetwork != nil && externalNetwork != (&govcd.ExternalNetwork{}) { | ||
d.Set("network_type", "ext") | ||
} else { | ||
return fmt.Errorf("issue to find 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.
A bit more context would help - network name, network type
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
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
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 needed. Testing ...
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
Bump to tagged version of govcd |
I have
If I remove the network in |
Well. Resource allows to change network type ext or org - so when I read/refresh I need to check which type it is. Now firstly search for org when for ext network if not found. I think it's ok - if anyone see value, so only one additional approach I see is throw error with complain that org and ext networks with same name exists. |
Could we lookup the network based on it's type? If it was an |
|
Signed-off-by: Vaidotas Bauzys <[email protected]>
Signed-off-by: Vaidotas Bauzys <[email protected]>
vcd/resource_vcd_dnat.go
Outdated
found = true | ||
} | ||
if orgVdcNetwork != nil && extNetwErr == nil { | ||
return fmt.Errorf("find external network or org VCD network with same name: %s", natRule.GatewayNatRule.Interface.Name) |
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.
return fmt.Errorf("find external network or org VCD network with same name: %s", natRule.GatewayNatRule.Interface.Name) | |
return fmt.Errorf("found external network or org VCD network with same name: %s", natRule.GatewayNatRule.Interface.Name) |
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
Signed-off-by: Vaidotas Bauzys <[email protected]>
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. Having duplicate networks now fails as I would expect. Test suite works.
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: terraform-providers/terraform-provider-vcd#244
Ref: https://github.com/terraform-providers/terraform-provider-vcd/pull/224
Depends on: vmware/go-vcloud-director#216
Uses nat rule Id's for handling rules. Also network_name and network_type used to handle which network to use. Old way left to be intact (allows only creating rule for first external network)