oxide_instance: allow in-place external_ips
modification
#381
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #378.
This patch updates the
oxide_instance
resource to support in-place modifications to itsexternal_ips
attribute. That is, the instance will no longer be destroyed and recreated whenexternal_ips
is modified. Instead, the instance will be stopped, external IPs will be detachd and/or attached, and the instance will be started.This patch also updates the
Read
method to refresh the external IPs attached to the instance. Previously, since the external IPs required a resource replacement there was no need to refresh them.There are 2 types of external IPs, ephemeral and floating. There can be at most 1 ephemeral external IP attached to an instance and any number of floating external IPs. That means in order to modify ephemeral external IPs the external IPs must be detached first and then attached.
This patch needs the following work before it can be merged.
external_ips
modification logic.external_ips
to enforce at most 1 ephemeral external IP. This was previously "validated" during instance creation but is not updated during instance update.Here's the error that's returned when an instance is created with more than 1 ephemeral external IP.