[27.x backport] IPv6 only: add API option enable/disable IPv4#48343
Closed
[27.x backport] IPv6 only: add API option enable/disable IPv4#48343
Conversation
Signed-off-by: Rob Murray <[email protected]> (cherry picked from commit a23dcf4) Signed-off-by: Paweł Gronowski <[email protected]>
Signed-off-by: Rob Murray <[email protected]> (cherry picked from commit d4d8611) Signed-off-by: Paweł Gronowski <[email protected]>
Similar to EnableIPv6:
- Set it if EnableIPv4 is specified in a create request.
- Otherwise, set it if included in `default-network-opts`.
- Apart from in a config-from network, so that it doesn't look
like the API request set the field.
- Include the new field in Network marshalling/unmarshalling test.
Signed-off-by: Rob Murray <[email protected]>
(cherry picked from commit 903daa4)
Signed-off-by: Paweł Gronowski <[email protected]>
Signed-off-by: Rob Murray <[email protected]> (cherry picked from commit 1f542d5) Signed-off-by: Paweł Gronowski <[email protected]>
akerouanton
requested changes
Aug 16, 2024
Member
akerouanton
left a comment
There was a problem hiding this comment.
This PR adds a new field to network.CreateOptions but it's not wired up yet. If we merge it, we might see users coming up and saying that this new field doesn't do anything. So, I think it's not worth backporting should be delayed until we do have all the other IPv6-only PRs merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
- What I did
--ipv4in the CLI, equivalent to--ipv6).com.docker.network.enable_ipv4.default-network-opts.EnableIPv4=false.EnableIPv4=true.\EnableIPv4in a network create request if the API version is less than 1.47.--experimentalto disable IPv4.Follow-up PRs will make the option do-something.
- How I did it
The first commit here, bumping the API version to 1.47, is likely to disappear - as this will be merged after another PR that does the same thing. But, for now, it means there's somewhere to put an API
version-history.mdupdate.The rest is fairly machanical copying of
EnableIPv6behaviour.- How to verify it
Can't disable IPv4 without
--experimental:With
--experimental, can disable IPv4:Default for a new bridge network is
true:Predefined host network shows
EnableIPv4:false, like the existingEnableIPv6:false:Predefined bridge network has
EnableIPv4:true:Marshalling/unmarshalling a
libnetwork.NetworkwithEnableIPv4:trueis covered in an updated unit test.- Description for the changelog