feat: expose registry name mapping methods#76
Conversation
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## main #76 +/- ##
==========================================
- Coverage 82.73% 82.46% -0.28%
==========================================
Files 6 6
Lines 388 382 -6
==========================================
- Hits 321 315 -6
Misses 45 45
Partials 22 22
|
| } | ||
|
|
||
| func mapStoreRegistryName(registry string) string { | ||
| func MapRegistryNameDockerIo(registry string) string { |
There was a problem hiding this comment.
The method name is not meaningful.
There was a problem hiding this comment.
This method maps a registry name to a key for credential store. Therefore, func ServerAddressFromRegistry(registry string) string with documentation is preferable.
There was a problem hiding this comment.
changed accordingly.
| } | ||
|
|
||
| func mapAuthenticationRegistryName(hostname string) string { | ||
| func MapRegistryNameRegistry1DockerIo(hostname string) string { |
There was a problem hiding this comment.
The method name is not meaningful.
There was a problem hiding this comment.
This method maps a host name to a key for credential store. Therefore, func ServerAddressFromHostname(hostname string) string with documentation is preferable.
There was a problem hiding this comment.
changed accordingly.
| // ServerAddressFromRegistry maps a registry to a server address, which is used as | ||
| // a key for credentials store. The Docker CLI expects that the credentials of | ||
| // the registry 'docker.io' 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 |
There was a problem hiding this comment.
nit: v24.0.2 is out.
| // See: https://github.com/moby/moby/blob/v24.0.0-beta.2/registry/config.go#L25-L48 | |
| // See: https://github.com/moby/moby/blob/v24.0.2/registry/config.go#L25-L48 |
There was a problem hiding this comment.
updated the version number.
| // ServerAddressFromHostname maps a hostname to a server address, which is used as | ||
| // a key for credentials store. It is expected that the traffic targetting the | ||
| // host "registry-1.docker.io" will be redirected to "https://index.docker.io/v1/". | ||
| // https://github.com/moby/moby/blob/v24.0.2/registry/config.go#L25-L48 |
There was a problem hiding this comment.
nit: consistency
| // https://github.com/moby/moby/blob/v24.0.2/registry/config.go#L25-L48 | |
| // See: https://github.com/moby/moby/blob/v24.0.2/registry/config.go#L25-L48 |
There was a problem hiding this comment.
Good catch.
Signed-off-by: Xiaoxuan Wang <wangxiaoxuan119@gmail.com>
Resolves #72