未验证 提交 38b54da8 编写于 作者: P priyawadhwa 提交者: GitHub

Merge pull request #7707 from prasadkatti/fix/skip_preload_if_image_repo_set

Skip preload download if --image-repository is set
......@@ -255,7 +255,7 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k
if strings.ToLower(repository) == "auto" || mirrorCountry != "" {
found, autoSelectedRepository, err := selectImageRepository(mirrorCountry, semver.MustParse(strings.TrimPrefix(k8sVersion, version.VersionPrefix)))
if err != nil {
exit.WithError("Failed to check main repository and mirrors for images for images", err)
exit.WithError("Failed to check main repository and mirrors for images", err)
}
if !found {
......@@ -269,7 +269,7 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k
repository = autoSelectedRepository
}
if cmd.Flags().Changed(imageRepository) {
if cmd.Flags().Changed(imageRepository) || cmd.Flags().Changed(imageMirrorCountry) {
out.T(out.SuccessType, "Using image repository {{.name}}", out.V{"name": repository})
}
......
......@@ -43,7 +43,8 @@ const (
// BeginCacheKubernetesImages caches images required for kubernetes version in the background
func beginCacheKubernetesImages(g *errgroup.Group, imageRepository string, k8sVersion string, cRuntime string) {
if download.PreloadExists(k8sVersion, cRuntime) {
// TODO: remove imageRepository check once #7695 is fixed
if imageRepository == "" && download.PreloadExists(k8sVersion, cRuntime) {
glog.Info("Caching tarball of preloaded images")
err := download.Preload(k8sVersion, cRuntime)
if err == nil {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册