|
@@ -320,7 +320,8 @@ func isCIDRMatch(cidrs []*registry.NetIPNet, URLHost string) bool {
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
-// ValidateMirror validates an HTTP(S) registry mirror
|
|
|
+// ValidateMirror validates an HTTP(S) registry mirror. It is used by the daemon
|
|
|
+// to validate the daemon configuration.
|
|
|
func ValidateMirror(val string) (string, error) {
|
|
|
uri, err := url.Parse(val)
|
|
|
if err != nil {
|
|
@@ -340,7 +341,8 @@ func ValidateMirror(val string) (string, error) {
|
|
|
return strings.TrimSuffix(val, "/") + "/", nil
|
|
|
}
|
|
|
|
|
|
-// ValidateIndexName validates an index name.
|
|
|
+// ValidateIndexName validates an index name. It is used by the daemon to
|
|
|
+// validate the daemon configuration.
|
|
|
func ValidateIndexName(val string) (string, error) {
|
|
|
// TODO: upstream this to check to reference package
|
|
|
if val == "index.docker.io" {
|
|
@@ -426,8 +428,10 @@ func newRepositoryInfo(config *serviceConfig, name reference.Named) (*Repository
|
|
|
}, nil
|
|
|
}
|
|
|
|
|
|
-// ParseRepositoryInfo performs the breakdown of a repository name into a RepositoryInfo, but
|
|
|
-// lacks registry configuration.
|
|
|
+// ParseRepositoryInfo performs the breakdown of a repository name into a
|
|
|
+// [RepositoryInfo], but lacks registry configuration.
|
|
|
+//
|
|
|
+// It is used by the Docker cli to interact with registry-related endpoints.
|
|
|
func ParseRepositoryInfo(reposName reference.Named) (*RepositoryInfo, error) {
|
|
|
return newRepositoryInfo(emptyServiceConfig, reposName)
|
|
|
}
|