instance: add support for dual-stack network interace #591
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.
Still a WIP, but I want to check if the acceptance tests are now passing in CI so opening it as a draft.
Relates to SSE-141
Incoming wall of text for what's missing.
I need to write more tests and figure out the upgrade path to avoid an in-place upgrade (which could the instance to restart) or full instance replacement. I tried to avoid a state migration, but I don't think there's a away around it. And even with a state migration achieving this could be tricky.
The main issue is that we don't know, from an old state, if a network interface was created with an empty IP address (auto mode) or an explicit IP. Since
ip_addressisComputed + Optional, in both cases we will have a value in the attribute.When migrating to the new schema, the user could have one of the two configs:
When migrating to the new version, they would need to update their config file to look like this in each case:
But both old configs generate the same state, where
ip_address = "10.1.2.3"(or whatever the auto IP was), and so we have two options for the migration:ip_assignmentto the oldip_addressvalue.ip_assignmentto"auto".Regardless of the option we choose, we'll break the other. For example, going with option 1 will force all users to update their configs to the explicit IP address config above, even if they created the instance with auto-assigned IP.
One thing that I thought about, but that I need to investigate more, is to try and make
v4.ip_assignmentoptional, and so users that are migrating to the new version could use an emptyv4 = {}block to indicate that we don't know the IP assignment is. We could then possibly use aPlanModifierto figure out the right value to use, but I'm not really sure if it will be possible.Pull request checklist