Skip to content

Conversation

@CFSworks
Copy link
Contributor

@CFSworks CFSworks commented Sep 9, 2023

Currently, containerd treats ip_pref = "ipv6" the same as ip_pref = "cni", because the loop meant to select the first IPv6 address instead selects the first IP address of any kind.

This problem has been allowed to go unnoticed because the test case said to check the behavior when the first input address is an IPv4 address is actually providing an IPv6 address first.

This PR corrects both of the above.

The ip.To16() function returns non-nil if `ip` is any kind
of IP address, including IPv4. To look for IPv6 specifically,
use ip.To4() == nil.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
Signed-off-by: Sam Edwards <CFSworks@gmail.com>
@k8s-ci-robot
Copy link

Hi @CFSworks. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@kzys kzys added cherry-pick/1.6.x cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Oct 6, 2023
@thaJeztah
Copy link
Member

/cherrypick release/1.7

@k8s-infra-cherrypick-robot

@thaJeztah: #9076 failed to apply on top of branch "release/1.7":

Applying: Don't use `To16() != nil` to detect IPv6 addresses
Applying: Fix "even if IPv4 comes first" test to have IPv4 first
Using index info to reconstruct a base tree...
M	pkg/cri/sbserver/sandbox_run_test.go
M	pkg/cri/server/sandbox_run_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/cri/server/sandbox_run_test.go
CONFLICT (content): Merge conflict in pkg/cri/server/sandbox_run_test.go
Auto-merging pkg/cri/sbserver/sandbox_run_test.go
CONFLICT (content): Merge conflict in pkg/cri/sbserver/sandbox_run_test.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config advice.mergeConflict false"
Patch failed at 0002 Fix "even if IPv4 comes first" test to have IPv4 first

Details

In response to this:

/cherrypick release/1.7

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@thaJeztah thaJeztah added cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch and removed cherry-pick/1.7.x Change to be cherry picked to release/1.7 branch labels Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked/1.7.x PR commits are cherry-picked into release/1.7 branch needs-ok-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants