Skip to content
This repository was archived by the owner on Apr 7, 2024. It is now read-only.
This repository was archived by the owner on Apr 7, 2024. It is now read-only.

Expose the registry name mapping methods #72

@Wwwsylvia

Description

@Wwwsylvia

As users may still need to do the mapping from docker.io to https://index.docker.io/v1/ in their code when using Store.Get(), Store.Put() and Store.Delete(), we can consider expose the existing mapping methods for their convenience.

We may export the following methods and may rename them if needed:

  • func mapStoreRegistryName(registry string) string {
    // The Docker CLI expects that the 'docker.io' credential
    // will be added under the key "https://index.docker.io/v1/"
    // See: https://github.com/moby/moby/blob/v24.0.0-beta.2/registry/config.go#L25-L48
    if registry == "docker.io" {
    return "https://index.docker.io/v1/"
    }
    return registry
    }
  • func mapAuthenticationRegistryName(hostname string) string {
    // It is expected that the traffic targetting "registry-1.docker.io"
    // will be redirected to "https://index.docker.io/v1/"
    // See: https://github.com/moby/moby/blob/v24.0.0-beta.2/registry/config.go#L25-L48
    if hostname == "registry-1.docker.io" {
    return "https://index.docker.io/v1/"
    }
    return hostname
    }

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions