diff --git a/pkg/images/puller.go b/pkg/images/puller.go index 43e9126..6429040 100644 --- a/pkg/images/puller.go +++ b/pkg/images/puller.go @@ -72,7 +72,7 @@ func (is *imageService) PullImage(ctx context.Context, ref appv1alpha1.Ref, opts } ref.Name = originNamed.String() // replaced image ref - replacedRef, plainHTTP := utils.ReplacedImageRef(mirrorsEndpoint, originNamed.String(), true) + replacedRef, plainHTTP := utils.ReplacedImageRef(mirrorsEndpoint, originNamed.String(), false) config := newFetchConfig(plainHTTP) ongoing := newJobs(replacedRef, originNamed.String()) diff --git a/pkg/utils/k8sutil.go b/pkg/utils/k8sutil.go index ff7af86..0879602 100644 --- a/pkg/utils/k8sutil.go +++ b/pkg/utils/k8sutil.go @@ -166,7 +166,9 @@ func ReplacedImageRef(mirrorsEndpoint []string, oldImageRef string, checkConnect parts := strings.Split(oldImageRef, "/") klog.Infof("parts: %s", parts) - parts[0] = url.Host + if parts[0] == "docker.io" { + parts[0] = url.Host + } klog.Infof("parts2: %s", parts) return strings.Join(parts, "/"), plainHTTP }