-
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
Add Edge Gateway DHCP relay configuration support #416
Merged
Merged
Changes from 9 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
d09d560
Acceptance test passes
Didainius 3b63deb
WIP
Didainius 517810d
WIP2
Didainius 5d0223a
Add website, tests
Didainius 427dc09
Add field descriptions
Didainius 2e7f8bf
Add changelog note
Didainius 361c60c
Add vendor
Didainius 95e94bf
Do not check data source in update stage
Didainius 525ce8d
Remove commented field
Didainius dfcd505
Address comments
Didainius 9543a60
Bump govcd
Didainius 19e4ac9
Address comments
Didainius 9a81246
Migrate vdc lookup
Didainius 8e9e452
Merge master
Didainius 580d988
Fix errors, bump govcd
Didainius 8ca5fff
Remove unused functions
Didainius aec95c7
go mod vendor
Didainius c1cc3bc
go mod tidy
Didainius 1962917
Rename field 'org_network' -> 'network_name'
Didainius c9a172e
Field rename test cleanup
Didainius File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package vcd | ||
|
||
import ( | ||
"github.com/hashicorp/terraform-plugin-sdk/helper/schema" | ||
) | ||
|
||
func datasourceVcdNsxvDhcpRelay() *schema.Resource { | ||
return &schema.Resource{ | ||
Read: resourceVcdNsxvDhcpRelayRead, | ||
Schema: map[string]*schema.Schema{ | ||
"org": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
ForceNew: true, | ||
Description: "The name of organization to use, optional if defined at provider " + | ||
"level. Useful when connected as sysadmin working across different organizations", | ||
}, | ||
"vdc": { | ||
Type: schema.TypeString, | ||
Optional: true, | ||
ForceNew: true, | ||
Description: "The name of VDC to use, optional if defined at provider level", | ||
}, | ||
"edge_gateway": &schema.Schema{ | ||
Type: schema.TypeString, | ||
Required: true, | ||
ForceNew: true, | ||
Description: "Edge gateway name for DHCP relay settings", | ||
}, | ||
"ip_addresses": { | ||
Computed: true, | ||
Type: schema.TypeSet, | ||
Description: "A set of IP address of DHCP servers", | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, | ||
}, | ||
}, | ||
"domain_names": { | ||
Computed: true, | ||
Type: schema.TypeSet, | ||
Description: "A set of IP domain names of DHCP servers", | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, | ||
}, | ||
}, | ||
"ip_sets": { | ||
Computed: true, | ||
Type: schema.TypeSet, | ||
Description: "A set of IP set names which consist DHCP servers", | ||
Elem: &schema.Schema{ | ||
Type: schema.TypeString, | ||
}, | ||
}, | ||
"relay_agent": { | ||
Computed: true, | ||
Type: schema.TypeSet, | ||
Elem: &schema.Resource{ | ||
Schema: map[string]*schema.Schema{ | ||
"org_network": { | ||
Computed: true, | ||
Type: schema.TypeString, | ||
Description: "Org network which is to be used for relaying DHCP message to specified servers", | ||
}, | ||
"gateway_ip_address": { | ||
Computed: true, | ||
Type: schema.TypeString, | ||
Description: "Optional gateway IP address of org network which is to be used for relaying DHCP message to specified servers", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Two comments:
1.) It seems, in H5 UI in addition to Org networks you can select external network:
Are you sure it's only org networks?
2.) I'm also thinking whether we shouldn't rename
org_network
->org_network_name
for clarity. It would be similar tonetwork_name
invcd_nsxv_snat
resource.3.) And continuing on the train of thought of (1) and (2), if it turns out that we can select external network, then we could just name the field
network_name
as in NAT rules.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.
Yes. It does allow to choose, but here is what happens:
Can do. I kind of thought between this and that. In some places we don't ask for "name", in some we do. (like
edge_gateway
also asks for name, but we don't mention it).I can make it broader - maybe in future it works although for my limited understanding this wouldn't make sense. The general point of relay is to "forward" DHCP request messages to defined servers outside of NSX. One shouldn't be able to forward DHCP request messages from external network. I might be wrong though.
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.
OK, so we have three choices:
org_network
org_network_name
network_name
@Didainius @dataclouder @vbauzysvmware your votes?
To me
network_name
looks most consistent with the same field from NSX-V NAT rules. However, it doesn't reflect the point that these are only Org networks.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.
network_name
is more generic and will work even if we end up supporting different kinds of networkThere 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 am fine with
network_name