-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Implement private_ip_address_version for network interfaces. #2548
Implement private_ip_address_version for network interfaces. #2548
Conversation
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.
hey @literatesnow
Thanks for this PR :)
I've taken a look through and left some comments in-line but this mostly LGTM - if we can fix up the comments (and the tests pass) we should be able to get this merged 👍
Thanks!
Hey @tombuildsstuff Thanks for the suggestions, I've updated the PR. The tests are failing with |
@literatesnow, i restarted the travis build and it seems to have passed now 🙂 |
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.
(accidental click)
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.
(double post)
Thanks @katbyte |
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.
Thank you for the updates! Aside from a couple comments i've left inline this is looking pretty good. I am mainly concerned with two unchecked dereferences that could result in a panic. Once those are nil checked this should be good to merge 🙂
Does this change applicable for VMSS (network_profile --> ip_configuration) ? |
Thanks for the suggestions @katbyte, the PR has been updated. I don't know @tdhineshkumar |
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.
Thank you for the updates, one last glance and i noticed that private_ip_address_version
is not in the schema, apologies for not noticing this earlier.
I'm not sure if its best to add it as a computed value or simply not set it on read, but right now it's a error that is silently ignored 😅
if privateIPAddress := ipProps.PrivateIPAddress; privateIPAddress != nil { | ||
d.Set("private_ip_address", *privateIPAddress) | ||
} | ||
d.Set("private_ip_address_version", string(ipProps.PrivateIPAddressVersion)) |
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 does not exist in the schema
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.
@katbyte Add private_ip_address_version
to the schema here? https://github.com/literatesnow/terraform-provider-azurerm/blob/b44b8b7275cbda465392b08df85c89a3c0fb04ab/azurerm/resource_arm_network_interface.go#L213
I'd say you'd know better if it's computed or not :)
@katbyte I've added the private IP address version to the schema (computed) and hopefully made other code more readable. |
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.
Upon further investigation it makes sense to not have the ip version at the top level so i have removed it, as well as cleaned up some crash points, hope you don't mind 🙂
this LGTM now, however @tombuildsstuff could you give it a quick once over as i did some updates?
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 LGTM 👍
Thank you @tombuildsstuff and @katbyte ! |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
Implements #2543 and allows IPv6
ip_configuration
s to be created inazurerm_network_interface
.private_ip_address_version
(IPv4/IPv6).subnet_id
becomes optional for IPv6 and required for IPv4.