diff --git a/vendor/github.com/containerd/cri/pkg/server/image_pull.go b/vendor/github.com/containerd/cri/pkg/server/image_pull.go index 942dcbeea7..196bfbf378 100644 --- a/vendor/github.com/containerd/cri/pkg/server/image_pull.go +++ b/vendor/github.com/containerd/cri/pkg/server/image_pull.go @@ -346,6 +346,17 @@ func (c *criService) registryHosts(auth *runtime.AuthConfig) docker.RegistryHost } } +// defaultScheme returns the default scheme for a registry host. +func defaultScheme(host string) string { + if h, _, err := net.SplitHostPort(host); err == nil { + host = h + } + if host == "localhost" || host == "127.0.0.1" || host == "::1" { + return "http" + } + return "https" +} + // registryEndpoints returns endpoints for a given host. // It adds default registry endpoint if it does not exist in the passed-in endpoint list. // It also supports wildcard host matching with `*`. @@ -371,7 +382,7 @@ func (c *criService) registryEndpoints(host string) ([]string, error) { return endpoints, nil } } - return append(endpoints, "https://"+defaultHost), nil + return append(endpoints, defaultScheme(defaultHost)+"://"+defaultHost), nil } // newTransport returns a new HTTP transport used to pull image. diff --git a/vendor/modules.txt b/vendor/modules.txt index 48315445a4..bb1e4d46bf 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -288,7 +288,7 @@ github.com/containerd/continuity/pathdriver github.com/containerd/continuity/devices github.com/containerd/continuity/driver github.com/containerd/continuity/proto -# github.com/containerd/cri v1.11.1-0.20191009213552-1fb415d208be +# github.com/containerd/cri v0.0.0-00010101000000-000000000000 => github.com/rancher/cri v1.3.0-k3s.2 github.com/containerd/cri github.com/containerd/cri/pkg/config github.com/containerd/cri/pkg/constants