Giter Club home page Giter Club logo

Comments (8)

aojea avatar aojea commented on May 28, 2024 1

distribution/distribution#3489

from containerd.

brandond avatar brandond commented on May 28, 2024 1

Thanks @aojea for getting this working in distribution and eventually kubernetes ;)

from containerd.

brandond avatar brandond commented on May 28, 2024

Use of IPv6 literals in the image name works in Kubernetes 1.29, which uses docker/distribution v2.8.3 which uses distribution/reference as the backend for docker/distribution/reference. Older releases that are still on v2.8.2 will fail to schedule pods that use an ipv6 literal as the image registry:

    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

This is unrelated to the issue of needing to support IPv6 addresses in mirror endpoints though.

from containerd.

brandond avatar brandond commented on May 28, 2024

fwiw go-toml itself doesn't handle round-trip this properly either. There does not appear to be any way to escape characters in table keys.

package main

import (
	"fmt"

	"github.com/pelletier/go-toml"
)

type Entry struct {
	Foo string
}

type Thing struct {
	Entries map[string]Entry
}

func main() {
	foo := Thing{
		Entries: map[string]Entry{
			"https://[::1]/v2": {
				Foo: "foo",
			},
		},
	}
	b, err := toml.Marshal(foo)
	fmt.Printf("Marshal error=%v\n%s\n", err, b)
	err = toml.Unmarshal(b, &foo)
	fmt.Printf("Unmarshal error=%v\n", err)
}
Marshal error=<nil>

[Entries]

  [Entries."https://[::1]/v2"]
    Foo = "foo"

Unmarshal error=(4, 4): unexpected token table key cannot contain ']', was expecting a table key

from containerd.

brandond avatar brandond commented on May 28, 2024

Added a very hacky proposed fix in #10072

from containerd.

brandond avatar brandond commented on May 28, 2024

@samuelkarp would you prefer to discuss the preferred approach to this here? I'll paste what I said on the PR:

Honestly this datastructure should have been a table list with a server field for each entry, rather than trying to get clever and put the server URL in the table key. Using a list would have also avoided all the weirdness with having to re-parse the tree to get the key order from line numbers in the file.

[[host]]
  server = "https://[fd7c:53a5:aef5::242:ac11:7]/v2"
  capabilities = ["pull", "resolve"]
  skip_verify = true

Since containerd 2.0 isn't out yet, now might be a good time to fix this.

from containerd.

samuelkarp avatar samuelkarp commented on May 28, 2024

Honestly this datastructure should have been a table list with a server field for each entry, rather than trying to get clever and put the server URL in the table key.

I agree.

Since containerd 2.0 isn't out yet, now might be a good time to fix this.

If so, we'll need to get it done and in fairly quickly; 2.0.0-rc.0 is already out and we've tried to give advance warning of breaking changes like this. It may be more feasible to add an override, or to try and fix the port-parsing such that a valid IPv6 address is not mistaken for something with a port appended.

@dmcgowan I'd appreciate your thoughts on this.

from containerd.

brandond avatar brandond commented on May 28, 2024

I'll have to poke at the go-toml/v2 parser that containerd 2.0 uses, but I was considering trying to get it to support both the existing [host."example.com"] or proposed [[host]]/server="example.com" structure, as long as the file doesn't mix between both. I think that should be doable.

I should have some cycles for a POC next week.

from containerd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.