-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/vsphere: read gateway information #6522
Conversation
Should one of our test caught this? We don't need another test, but I am thinking we should improve the test. |
The
|
@@ -795,6 +795,19 @@ func resourceVSphereVirtualMachineRead(d *schema.ResourceData, meta interface{}) | |||
networkInterfaces = append(networkInterfaces, networkInterface) | |||
} | |||
} | |||
for _, v := range mvm.Guest.IpStack { | |||
for _, route := range v.IpRouteConfig.IpRoute { |
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 need to check for nil on these?? Can IpRouteConfig == nil
?
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. I think we need some more checks here. Guest
, IpStack
, IpRouteConfig
and IpRoute
could be nil
@chrislovecnm Fixed. Please review again :) |
@thetuxkeeper travis is not happy: builtin/providers/vsphere/resource_vsphere_virtual_machine.go:802: invalid operation: route.Gateway.Device != nil (mismatched types string and nil) |
oh, I missed that. I thought I checked it. go is not nice here ;) |
@chrislovecnm Fixed the nil/empty check
after 0fac39c:
|
Like I discovered in #6590 the |
@thetuxkeeper you want to fix ipv6? |
@chrislovecnm : yes. just pushed it. |
This seems good to me - I have no way of verifying whether the acceptance test is passing but I am happy to take @thetuxkeeper's word for it! Thanks all! |
@jen20 much thanks!! |
@jen20 : Thanks! I hope I can prove that I'm worth your trust. :) |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
The gateway was not read from the VM before and could have forced redeploying the VM when setting a static gateway.