The IPv6 address syntax allows forms such as ::ffff:192.0.2.128, but the reference parsing code, despite allowing other forms of IPv6 address, doesn't seem to allow these, even though the Go net package does.
For example, running against commit 8507c7f, this code fails:
package main
import (
"fmt"
"github.com/distribution/reference"
)
func main() {
_, err := reference.ParseAnyReference("[::ffff:192.0.2.128]/bar")
if err != nil {
fmt.Println("error:", err)
}
}
The error it prints is:
error: invalid reference format
Although the code says "Special addresses such as IPv4-Mapped are deliberately excluded", ISTM that that exclusion is not entirely warranted, as it's reasonable to specify an address in this way. The same cannot be said of zone identifiers.
The IPv6 address syntax allows forms such as
::ffff:192.0.2.128, but the reference parsing code, despite allowing other forms of IPv6 address, doesn't seem to allow these, even though the Go net package does.For example, running against commit 8507c7f, this code fails:
The error it prints is:
Although the code says "Special addresses such as IPv4-Mapped are deliberately excluded", ISTM that that exclusion is not entirely warranted, as it's reasonable to specify an address in this way. The same cannot be said of zone identifiers.