-
Notifications
You must be signed in to change notification settings - Fork 85
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 inter VRF routing resource #1167
Conversation
0e242f9
to
6853a8e
Compare
/test-all |
6853a8e
to
3669681
Compare
/test-all |
Type: schema.TypeList, | ||
Description: "route map path for IN direction", | ||
Optional: true, | ||
MaxItems: 1, |
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.
Is there a reason those lists with size 1 are still lists? If we're following the API that expects to grow in future, maybe we shouldn't code the MaxItems
in the provider to prevent the requirement for future change.
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.
IDK why it's defined as it is - they're lists in the spec. Do you think that we can remove MaxItems
and let NSX enforce the limit?
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.
Otherwise I could flatten these attributes
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'm in favor of letting NSX enforce the limit
d.Set("nsx_id", d.Id()) | ||
gwPath, err := getParameterFromPolicyPath("", "/inter-vrf-routing/", importID) | ||
if err != nil { | ||
return nil, err |
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 this error message should be something like incorrect policy path for inter vrf routing resource: %v
connector := getPolicyConnector(m) | ||
client := tier_0s.NewInterVrfRoutingClient(connector) | ||
|
||
gwPolicyPath := d.Get("gateway_path").(string) |
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 its more reliable to rely on path
here and in update
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.
Do we have a utility func to parse the gwID
from path
?
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.
Not this one specifically..
* `description` - (Optional) Description of the resource. | ||
* `tag` - (Optional) A list of scope + tag pairs to associate with this resource. | ||
* `nsx_id` - (Optional) The NSX ID of this resource. If set, this ID will be used to create the policy resource. | ||
* `gateway_path` - (Required) The NSX Policy path to the Tier0 or Tier1 Gateway for this NAT Rule. |
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.
This description doesn't seem right
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.
Indeed, it's only T0
3b6d517
to
ceee384
Compare
* `description` - (Optional) Description of the resource. | ||
* `tag` - (Optional) A list of scope + tag pairs to associate with this resource. | ||
* `nsx_id` - (Optional) The NSX ID of this resource. If set, this ID will be used to create the policy resource. | ||
* `gateway_path` - (Required) The NSX Policy path to the Tier0 Gateway for this NAT Rule. |
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.
for this NAT Rule
=> for this resource
if id == "" { | ||
id = newUUID() | ||
} | ||
|
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.
We usually check that object with this nsx_id
does not exist yet, here this check is missing, is this intentional?
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.
No, I guess that I've copy-pasted from the wrong place :)
Seems that there are quite a lot of cases where we do not check this. Maybe it's worthwhile to add this to some TODO list?
I think this resource is also relevant for GM? |
Fixes: vmware#1051 Signed-off-by: Kobi Samoray <[email protected]>
ceee384
to
5c42c7b
Compare
Indeed looks like support for GM is different - |
Makes sense |
/test-all |
Fixes: #1051