forked from rancher/types
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mirror.go
30 lines (25 loc) · 1.24 KB
/
mirror.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package image
import "strings"
var Mirrors = map[string]string{}
func Mirror(image string) string {
orig := image
if strings.HasPrefix(image, "weaveworks") {
return image
}
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)
image = strings.Replace(image, "plugins/docker", "rancher/plugins-docker", 1)
image = strings.Replace(image, "k8s.gcr.io/defaultbackend", "rancher/nginx-ingress-controller-defaultbackend", 1)
image = strings.Replace(image, "k8s.gcr.io/k8s-dns-node-cache", "rancher/k8s-dns-node-cache", 1)
image = strings.Replace(image, "plugins/docker", "rancher/plugins-docker", 1)
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)
image = strings.Replace(image, "coredns/", "rancher/coredns-", 1)
image = strings.Replace(image, "minio/", "rancher/minio-", 1)
Mirrors[image] = orig
return image
}