Skip to content
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

Merged

Conversation

literatesnow
Copy link
Contributor

Implements #2543 and allows IPv6 ip_configurations to be created in azurerm_network_interface.

  • Added private_ip_address_version (IPv4/IPv6).
  • subnet_id becomes optional for IPv6 and required for IPv4.

Copy link
Contributor

@tombuildsstuff tombuildsstuff left a 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!

azurerm/resource_arm_network_interface.go Outdated Show resolved Hide resolved
azurerm/resource_arm_network_interface.go Outdated Show resolved Hide resolved
azurerm/resource_arm_network_interface.go Outdated Show resolved Hide resolved
azurerm/resource_arm_network_interface.go Outdated Show resolved Hide resolved
@literatesnow
Copy link
Contributor Author

Hey @tombuildsstuff

Thanks for the suggestions, I've updated the PR.

The tests are failing with fork: Cannot allocate memory, problem with Travis CI?

@ghost ghost removed the waiting-response label Dec 29, 2018
@katbyte
Copy link
Collaborator

katbyte commented Dec 29, 2018

@literatesnow, i restarted the travis build and it seems to have passed now 🙂

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(accidental click)

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(double post)

@literatesnow
Copy link
Contributor Author

Thanks @katbyte

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@literatesnow,

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 🙂

azurerm/resource_arm_network_interface.go Outdated Show resolved Hide resolved
azurerm/resource_arm_network_interface.go Outdated Show resolved Hide resolved
azurerm/resource_arm_network_interface.go Outdated Show resolved Hide resolved
@tdhineshkumar
Copy link

Does this change applicable for VMSS (network_profile --> ip_configuration) ?

@ghost ghost removed the waiting-response label Jan 2, 2019
@literatesnow
Copy link
Contributor Author

Thanks for the suggestions @katbyte, the PR has been updated.

I don't know @tdhineshkumar

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@literatesnow,

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))
Copy link
Collaborator

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

Copy link
Contributor Author

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 :)

@literatesnow
Copy link
Contributor Author

@katbyte I've added the private IP address version to the schema (computed) and hopefully made other code more readable.

@ghost ghost removed the waiting-response label Jan 5, 2019
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@literatesnow,

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?

@katbyte katbyte added this to the 1.21.0 milestone Jan 7, 2019
Copy link
Contributor

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise LGTM 👍

@tombuildsstuff
Copy link
Contributor

Ignoring a known test failure the tests pass:

screenshot 2019-01-07 at 12 27 45

@tombuildsstuff tombuildsstuff merged commit a21a7e7 into hashicorp:master Jan 7, 2019
tombuildsstuff added a commit that referenced this pull request Jan 7, 2019
@literatesnow
Copy link
Contributor Author

Thank you @tombuildsstuff and @katbyte !

@ghost
Copy link

ghost commented Mar 5, 2019

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!

@ghost ghost locked and limited conversation to collaborators Mar 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants