Skip to content

Commit

Permalink
Merge pull request #11948 from aspectcapital/issue11934
Browse files Browse the repository at this point in the history
Retain full container name when passing --image-repository
  • Loading branch information
sharifelgamal authored Jul 13, 2021
2 parents aa92f41 + f452a08 commit be6b203
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 14 deletions.
8 changes: 4 additions & 4 deletions pkg/minikube/bootstrapper/images/images.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,19 @@ func storageProvisioner(mirror string) string {
// dashboardFrontend returns the image used for the dashboard frontend
func dashboardFrontend(repo string) string {
if repo == "" {
repo = "docker.io/kubernetesui"
repo = "docker.io"
}
// See 'kubernetes-dashboard' in deploy/addons/dashboard/dashboard-dp.yaml
return path.Join(repo, "dashboard:v2.1.0")
return path.Join(repo, "kubernetesui", "dashboard:v2.1.0")
}

// dashboardMetrics returns the image used for the dashboard metrics scraper
func dashboardMetrics(repo string) string {
if repo == "" {
repo = "docker.io/kubernetesui"
repo = "docker.io"
}
// See 'dashboard-metrics-scraper' in deploy/addons/dashboard/dashboard-dp.yaml
return path.Join(repo, "metrics-scraper:v1.0.4")
return path.Join(repo, "kubernetesui", "metrics-scraper:v1.0.4")
}

// KindNet returns the image used for kindnet
Expand Down
6 changes: 3 additions & 3 deletions pkg/minikube/bootstrapper/images/images_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ func TestAuxiliary(t *testing.T) {

func TestAuxiliaryMirror(t *testing.T) {
want := []string{
"test.mirror/storage-provisioner:" + version.GetStorageProvisionerVersion(),
"test.mirror/dashboard:v2.1.0",
"test.mirror/metrics-scraper:v1.0.4",
"test.mirror/k8s-minikube/storage-provisioner:" + version.GetStorageProvisionerVersion(),
"test.mirror/kubernetesui/dashboard:v2.1.0",
"test.mirror/kubernetesui/metrics-scraper:v1.0.4",
}
got := auxiliary("test.mirror")
if diff := cmp.Diff(want, got); diff != "" {
Expand Down
6 changes: 3 additions & 3 deletions pkg/minikube/bootstrapper/images/kubeadm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ func TestKubeadmImages(t *testing.T) {
"mirror.k8s.io/coredns:1.6.2",
"mirror.k8s.io/etcd:3.3.15-0",
"mirror.k8s.io/pause:3.1",
"mirror.k8s.io/storage-provisioner:" + version.GetStorageProvisionerVersion(),
"mirror.k8s.io/dashboard:v2.1.0",
"mirror.k8s.io/metrics-scraper:v1.0.4",
"mirror.k8s.io/k8s-minikube/storage-provisioner:" + version.GetStorageProvisionerVersion(),
"mirror.k8s.io/kubernetesui/dashboard:v2.1.0",
"mirror.k8s.io/kubernetesui/metrics-scraper:v1.0.4",
}},
{"v1.15.0", "", false, []string{
"k8s.gcr.io/kube-proxy:v1.15.0",
Expand Down
8 changes: 5 additions & 3 deletions pkg/minikube/bootstrapper/images/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ limitations under the License.

package images

import "path"

// DefaultKubernetesRepo is the default Kubernetes repository
const DefaultKubernetesRepo = "k8s.gcr.io"

Expand All @@ -29,8 +31,8 @@ func kubernetesRepo(mirror string) string {

// minikubeRepo returns the official minikube repository, or an alternate
func minikubeRepo(mirror string) string {
if mirror != "" {
return mirror
if mirror == "" {
mirror = "gcr.io"
}
return "gcr.io/k8s-minikube"
return path.Join(mirror, "k8s-minikube")
}
2 changes: 1 addition & 1 deletion pkg/minikube/node/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func beginDownloadKicBaseImage(g *errgroup.Group, cc *config.ClusterConfig, down
g.Go(func() error {
baseImg := cc.KicBaseImage
if baseImg == kic.BaseImage && len(cc.KubernetesConfig.ImageRepository) != 0 {
baseImg = strings.Replace(baseImg, "gcr.io/k8s-minikube", cc.KubernetesConfig.ImageRepository, 1)
baseImg = strings.Replace(baseImg, "gcr.io", cc.KubernetesConfig.ImageRepository, 1)
cc.KicBaseImage = baseImg
}
var finalImg string
Expand Down

0 comments on commit be6b203

Please sign in to comment.