Skip to content

Networking V2: Omit empty ExternalFixedIP IPAddress for the router#628

Merged
ozerovandrei merged 1 commit intoterraform-provider-openstack:masterfrom
kayrus:fix-router
Nov 13, 2019
Merged

Networking V2: Omit empty ExternalFixedIP IPAddress for the router#628
ozerovandrei merged 1 commit intoterraform-provider-openstack:masterfrom
kayrus:fix-router

Conversation

@kayrus
Copy link
Copy Markdown
Collaborator

@kayrus kayrus commented Jan 17, 2019

Resolves #449
Requires gophercloud/gophercloud#1414 to be fixed

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Jan 17, 2019

Build failed.

@ghost ghost added size/XL and removed size/XS labels Jan 19, 2019
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Jan 19, 2019

Build succeeded.

@kayrus
Copy link
Copy Markdown
Collaborator Author

kayrus commented Jan 19, 2019

@jtopjian ready for review

@jtopjian
Copy link
Copy Markdown
Contributor

@kayrus I feel like I'm going crazy.

Step 2 of the acceptance test isn't showing that the external_fixed_ip has an update, only enable_snat. Are you seeing the same thing?

Even adding logging statements in the d.HasChange("external_fixed_ip") block isn't showing the logs being made.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Jan 20, 2019

Build failed.

@kayrus
Copy link
Copy Markdown
Collaborator Author

kayrus commented Jan 21, 2019

Good catch, I was wondering why these tests have been passed, because I wrote them blindfold, since my environment is not capable to update routes. These tests are also skipped in openlab env, because there is no admin username.

Even adding logging statements in the d.HasChange("external_fixed_ip") block isn't showing the logs being made.

Looks like it is impossible to remove default external_fixed_ip... Besides this field marked as Computed therefore omitting it won't change the plan. Setting an empty list also doesn't give any effects. I've pushed an update to remove the 3rd ext IP. Could you please confirm whether it works for you?

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Jan 21, 2019

Build succeeded.

@ghost ghost added size/M and removed size/XL labels Jan 25, 2019
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Jan 25, 2019

Build succeeded.

@kayrus kayrus closed this Feb 26, 2019
@ghost ghost added size/XS and removed size/M labels Feb 26, 2019
@kayrus kayrus reopened this Feb 26, 2019
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Feb 26, 2019

Build succeeded.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Feb 26, 2019

Build failed.

@kayrus
Copy link
Copy Markdown
Collaborator Author

kayrus commented Feb 26, 2019

@jtopjian can you run acceptance tests against your environment?

@kayrus
Copy link
Copy Markdown
Collaborator Author

kayrus commented Feb 27, 2019

@jtopjian I managed to run tests in my env. And I have some bad news:

  1. TypeList considers ordering, and when we have more than one external_fixed_ip, terraform tries to update the router
  2. We need to switch the external_fixed_ip to TypeMap with the hashing based on the subnet_id. If there is no custom hashing func, the computed ip_address will trigger the diff, and terraform will suggest to update the router
  3. Custom hashing func based on the subnet_id will ignore any ip_address modifications made by user, update func won't work on ip_address modification.

@jtopjian
Copy link
Copy Markdown
Contributor

@kayrus Thank you for the notes and for looking into this. I will review and see if I come to similar conclusions when I get some time. :)

@jtopjian
Copy link
Copy Markdown
Contributor

@kayrus I know I'm behind on this, but I have not forgotten about it.

@jtopjian
Copy link
Copy Markdown
Contributor

I'm sorry for the delay. I had some time to review this.

The problem you're describing already exists: if you declare multiple external_fixed_ip blocks and set the subnet_id and ip_address of both and if they are returned in a different order, there will be a diff.

I think there are two problem statements here:

  1. Being able to specify an external_fixed_ip without an ip_address. This is what How does ip_address in external_fixed_ip argument of openstack_networking_router_v2 get calculated? #449 is reporting.
  2. Declaring multiple external_fixed_ip blocks. This problem already exists.

Since no one has reported 2 yet, I have to wonder if anyone is declaring multiple external_fixed_ip blocks to begin with -- is there a legitimate use for this? I'm not trying to say the problem isn't valid, but since this problem already exists, is there anything preventing us from fixing #449 and looking at this second issue separately?

If we were to look at this second problem, we would not change external_fixed_ip to a TypeMap. It's a clever idea, but it's too much of a breaking change. We'll need to either look into a CustomizeDiff or create a separate resource to handle a router's gateway information.

@ghost ghost added size/L and removed size/XS labels Jul 27, 2019
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Jul 27, 2019

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Sep 21, 2019

Build failed.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Oct 31, 2019

Build succeeded.

@ghost ghost added size/M and removed size/L labels Nov 2, 2019
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Nov 2, 2019

Build succeeded.

@kayrus
Copy link
Copy Markdown
Collaborator Author

kayrus commented Nov 4, 2019

@ozerovandrei I think this is ready to be merged. Other related issues are addressed in #922, since there is no easy way to fix them.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Nov 4, 2019

Build failed.

  • terraform-provider-openstack-unittest : RETRY_LIMIT in 11m 29s
  • terraform-provider-openstack-acceptance-test : RETRY_LIMIT in 3h 09m 28s

@ozerovandrei
Copy link
Copy Markdown
Member

recheck

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Nov 9, 2019

Build succeeded.

Copy link
Copy Markdown
Member

@ozerovandrei ozerovandrei left a comment

Choose a reason for hiding this comment

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

LGTM

@ozerovandrei ozerovandrei merged commit ba5bec7 into terraform-provider-openstack:master Nov 13, 2019
@kayrus kayrus deleted the fix-router branch November 13, 2019 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How does ip_address in external_fixed_ip argument of openstack_networking_router_v2 get calculated?

3 participants