-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cannot use IPv6 literal in registry mirror endpoint #9897
Comments
Tracking this in containerd at containerd/containerd#10055 |
It appears that Kubernetes itself has similar issues, if I try to use root@systemd-node-1:/# kubectl get pod -n kube-system coredns-576548d8fb-bvcsc -o yaml | grep -A5 state
state:
waiting:
message: 'Failed to apply default image tag "[fd7c:53a5:aef5::242:ac11:7]/rancher/mirrored-coredns-coredns:1.10.1":
couldn''t parse image name "[fd7c:53a5:aef5::242:ac11:7]/rancher/mirrored-coredns-coredns:1.10.1":
invalid reference format'
reason: InvalidImageName
root@systemd-node-1:/# crictl pull [fd7c:53a5:aef5::242:ac11:7]/rancher/mirrored-coredns-coredns:1.10.1
Image is up to date for sha256:ead0a4a53df89fd173874b46093b6e62d8c72967bbf606d672c9e8c9b601a4fc Ref:
Bumping that library, and quoting the EDIT: this was actually fixed in distribution/reference@992adca which is in all tagged releases of |
This also breaks spegel on nodes with ipv6 as the primary address family, as we use # File generated by k3s. DO NOT EDIT.
server = "https://registry-1.docker.io/v2"
capabilities = ["pull", "resolve", "push"]
[host."https://[::1]:6443/v2"]
capabilities = ["pull", "resolve"]
ca = ["/var/lib/rancher/k3s/agent/server-ca.crt"]
client = [["/var/lib/rancher/k3s/agent/client-k3s-controller.crt", "/var/lib/rancher/k3s/agent/client-k3s-controller.key"]] |
I'll probably pull this in to our fork even if upstream doesn't accept it. We'll need to modify our hosts.toml generator to output escaped keys. Probably want to do that using a custom function in the template. |
Is there some workaround to get spegel working on ipv6 nodes? Afaict I can't configure k3s to use |
Nope, still broke on the containerd side. I may take a look at trying to upstream a fix for the April release cycle. |
This appears to be a bug in container's URL parsing, as well as a limitation of the toml configuration format.
Specifying an RFC2732-compliant URL containing an IPv6 address literal as a registry endpoint generates the following toml:
This fails to load because square braces are not valid in TOML keys:
What if we just remove the braces:
This results in the wrong behavior; the final octet of the IPv6 address literal is being used as the port. What about adding the port to the literal?
This allows the dialer to connect, however it appears that the requests fail because the host header sent in the request is invalid:
Pulling the image directly seems to work OK, as the host is already properly escaped:
The text was updated successfully, but these errors were encountered: