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

Extend ignored_guest_ips to support CIDR networks #841

Merged
merged 2 commits into from
Dec 18, 2019
Merged

Extend ignored_guest_ips to support CIDR networks #841

merged 2 commits into from
Dec 18, 2019

Conversation

isometry
Copy link
Contributor

@isometry isometry commented Sep 16, 2019

  • Correctly parse CIDR networks included in the ignored_guest_ips list, allowing entire arbitrary IP ranges to be ignored.
  • Compare guest IP addresses to ignored_guest_ips using net.IP.Equal() rather than raw string comparison, enhancing support for variations in IPv6 representation.

@ghost ghost added size/xs Relative Sizing: Extra-Small documentation Type: Documentation labels Sep 16, 2019
@aareet aareet added the enhancement Type: Enhancement label Sep 16, 2019
@isometry
Copy link
Contributor Author

Patch updated following testing. Is there anything else required from me before this can be merged?

We need the functionality in order to prevent the provider from binding to the temporary DHCP IP temporarily detected even when we assign a fixed IP via Guest Customization, for example if the attached subnet hands out dynamic addresses in 10.0.0.128/25 but we need to assign a static IP outside that range, foo.default_ip_address will be a DHCP address which is no longer valid after VMware Guest Customization has completed:

resource "vsphere_virtual_machine" "foo" {
  …
  ignored_guest_ips = ["10.0.0.128/25"]
  clone {
    …
    customize {
      …
      network_interface {
        ipv4_address = 10.0.0.10
        ipv4_netmask = 24
      }
    }
  }
}

* Correctly parse CIDR networks included in the `ignored_guest_ips`
  list, allowing entire arbitrary IP ranges to be ignored.
* Enhance `ignored_guest_ips` comparison to ignore differences in string
  formatting (particularly useful for IPv6 addresses).
Copy link
Contributor

@koikonom koikonom left a comment

Choose a reason for hiding this comment

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

Hi @isometry,

First of all, thanks for taking the time to submit the PR. The feature you introduce looks useful. I have a comment around the validation of the CIDR strings, but other than that it looks OK.

@koikonom koikonom added the waiting-response Status: Waiting on a Response label Nov 6, 2019
@ghost ghost added size/s Relative Sizing: Small and removed size/xs Relative Sizing: Extra-Small labels Nov 17, 2019
@isometry isometry requested a review from koikonom November 17, 2019 19:08
@aareet aareet removed the waiting-response Status: Waiting on a Response label Nov 18, 2019
@isometry
Copy link
Contributor Author

isometry commented Dec 3, 2019

@koikonom : I'm not sure why this PR is still marked "Changes Requested", but I implemented the changes you suggested two weeks ago. Any chance of getting this merged before v1.14.0?

@koikonom
Copy link
Contributor

koikonom commented Dec 3, 2019

Hi @isometry, I am sorry for the delay. We have been having some issues with our acceptance tests lately so I've spent all my time getting these in order first. Once we are confident that things are back in working order I will merge this PR (before v1.14.0).

Copy link
Contributor

@koikonom koikonom left a comment

Choose a reason for hiding this comment

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

LGTM

@koikonom koikonom merged commit 921bbe6 into hashicorp:master Dec 18, 2019
@ghost ghost locked and limited conversation to collaborators Apr 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Type: Documentation enhancement Type: Enhancement size/s Relative Sizing: Small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants