2018-04-21 01:38:52 +00:00
|
|
|
package image
|
|
|
|
|
|
|
|
import "strings"
|
|
|
|
|
|
|
|
var Mirrors = map[string]string{}
|
|
|
|
|
|
|
|
func Mirror(image string) string {
|
|
|
|
orig := image
|
2020-02-25 15:49:47 +00:00
|
|
|
if strings.HasPrefix(image, "weaveworks") {
|
|
|
|
return image
|
|
|
|
}
|
2018-04-21 01:38:52 +00:00
|
|
|
|
|
|
|
image = strings.Replace(image, "gcr.io/google_containers", "rancher", 1)
|
|
|
|
image = strings.Replace(image, "quay.io/coreos/", "rancher/coreos-", 1)
|
|
|
|
image = strings.Replace(image, "quay.io/calico/", "rancher/calico-", 1)
|
2019-09-17 13:47:34 +00:00
|
|
|
image = strings.Replace(image, "plugins/docker", "rancher/plugins-docker", 1)
|
2020-01-12 08:28:09 +00:00
|
|
|
image = strings.Replace(image, "k8s.gcr.io/defaultbackend", "rancher/nginx-ingress-controller-defaultbackend", 1)
|
2019-09-17 13:47:34 +00:00
|
|
|
image = strings.Replace(image, "k8s.gcr.io/k8s-dns-node-cache", "rancher/k8s-dns-node-cache", 1)
|
2019-09-27 06:32:28 +00:00
|
|
|
image = strings.Replace(image, "plugins/docker", "rancher/plugins-docker", 1)
|
2018-04-21 01:38:52 +00:00
|
|
|
image = strings.Replace(image, "kibana", "rancher/kibana", 1)
|
|
|
|
image = strings.Replace(image, "jenkins/", "rancher/jenkins-", 1)
|
|
|
|
image = strings.Replace(image, "alpine/git", "rancher/alpine-git", 1)
|
|
|
|
image = strings.Replace(image, "prom/", "rancher/prom-", 1)
|
|
|
|
image = strings.Replace(image, "quay.io/pires", "rancher", 1)
|
2019-04-08 22:26:39 +00:00
|
|
|
image = strings.Replace(image, "coredns/", "rancher/coredns-", 1)
|
2019-04-26 18:44:31 +00:00
|
|
|
image = strings.Replace(image, "minio/", "rancher/minio-", 1)
|
2018-04-21 01:38:52 +00:00
|
|
|
|
|
|
|
Mirrors[image] = orig
|
|
|
|
return image
|
|
|
|
}
|