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

Bug 1808973: azurerm terraform fixes for address_prefixes #1

Merged

Conversation

jhixson74
Copy link
Member

@jhixson74 jhixson74 commented Mar 4, 2020

When a subnet uses address_prefixes, address_prefix is null in the virtual network resource. Add address_prefixes to virtual network resource and allow null for address_prefix. Don't assume IPv4 for private_ip_address on load balancer resource.

https://bugzilla.redhat.com/show_bug.cgi?id=1805251
https://bugzilla.redhat.com/show_bug.cgi?id=1808973
https://bugzilla.redhat.com/show_bug.cgi?id=1805936
https://bugzilla.redhat.com/show_bug.cgi?id=1808969

@openshift-ci-robot openshift-ci-robot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Mar 4, 2020
@openshift-ci-robot
Copy link

@jhixson74: This pull request references Bugzilla bug 1808973, which is invalid:

  • expected dependent Bugzilla bug 1808969 to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), but it is NEW instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1808973: [WIP] azurerm terraform fixes for address_prefixes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 4, 2020
@abhinavdahiya
Copy link

also would be nice to include tests that will be helpful when we take this patch upstream

c729756#diff-d70533cb8ca8baa7e2eccfb00ed05a55

@jhixson74 jhixson74 force-pushed the jhixson-release-1.41.0 branch 3 times, most recently from a6bcb82 to 5514c36 Compare March 5, 2020 05:10
@jhixson74
Copy link
Member Author

also would be nice to include tests that will be helpful when we take this patch upstream

c729756#diff-d70533cb8ca8baa7e2eccfb00ed05a55

I've added tests. I have no idea how to actually run them right now, but in theory they should work ;-)

@abhinavdahiya
Copy link

@openshift-ci-robot openshift-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 6, 2020
@jhixson74 jhixson74 force-pushed the jhixson-release-1.41.0 branch 2 times, most recently from dca947c to 5ccd5e9 Compare March 13, 2020 16:27
@jhixson74 jhixson74 changed the title Bug 1808973: [WIP] azurerm terraform fixes for address_prefixes Bug 1808973: azurerm terraform fixes for address_prefixes Mar 13, 2020
@jhixson74
Copy link
Member Author

jhixson74 commented Mar 13, 2020

John here are the docs for testing https://github.com/terraform-providers/terraform-provider-azurerm#developing-the-provider

I have updated the tests. They currently fail with:

Error: Error Creating/Updating Virtual Network "acctestvirtnet200313092520435843" (Resource Group "acctestRG-200313092520435843"): network.VirtualNetworksClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="SubscriptionNotRegisteredForFeature" Message="Subscription XXX is not registered for feature Microsoft.Network/AllowMultipleAddressPrefixesOnSubnet required to carry out the requested operation." Details=[]

This seems to be an issue with our subscription and not a logic issue.

@abhinavdahiya
Copy link

This is looking good except the comment #1 (comment)

The azure subnet resource allows for multiple address prefixes using the
address_prefixes argument. The virtual network resource allows inline subnets,
but does not currently support this argument. When the address_prefixes argument
is used, address_prefix will be null when terraform refreshes its state causing
terraform to panic. This code updates the virtual network resource to allow
address_prefixes to be used and for address_prefix to be null.

Tests have been added to test the multiple prefixes. The magic number in the
new tests is the same magic number used in the other VNet tests. I'm not 100%
clear on this number, but it appears to be a known ID. It's origin is
documented (not very well) here:

hashicorp#1913

This fix addresses the following bugs:

https://bugzilla.redhat.com/show_bug.cgi?id=1805251
https://bugzilla.redhat.com/show_bug.cgi?id=1808973
https://bugzilla.redhat.com/show_bug.cgi?id=1805936
https://bugzilla.redhat.com/show_bug.cgi?id=1808969
The azure load balancer resource's frontend_ip_configuration argument assumes
the IP address is only going to be IPv4. This removes that restriction to be
in line with the rest of the terraform code that does not have that validation.

https://bugzilla.redhat.com/show_bug.cgi?id=1808973
@jhixson74
Copy link
Member Author

This is looking good except the comment #1 (comment)

Commit message has been updated to explain this value.

@openshift-ci-robot
Copy link

@jhixson74: This pull request references Bugzilla bug 1808973, which is invalid:

  • expected dependent Bugzilla bug 1808969 to be in one of the following states: VERIFIED, RELEASE_PENDING, CLOSED (ERRATA), but it is ASSIGNED instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1808973: azurerm terraform fixes for address_prefixes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@abhinavdahiya abhinavdahiya merged commit beef025 into openshift:release-1.41.0 Mar 13, 2020
@openshift-ci-robot
Copy link

@jhixson74: All pull requests linked via external trackers have merged. Bugzilla bug 1808973 has been moved to the MODIFIED state.

In response to this:

Bug 1808973: azurerm terraform fixes for address_prefixes

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

fabianofranz pushed a commit to fabianofranz/terraform-provider-azurerm that referenced this pull request May 7, 2020
…sku-update

Updated to include TRIAL as a SKU
fabianofranz pushed a commit to fabianofranz/terraform-provider-azurerm that referenced this pull request May 7, 2020
Add network interface and security group association
jhixson74 pushed a commit to jhixson74/terraform-provider-azurerm that referenced this pull request Jul 7, 2020
…ent-path-validation

Update path validation for api management api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
4 participants