Merge pull request #7707 from prasadkatti/fix/skip_preload_if_image_repo_set
Skip preload download if --image-repository is setpull/7830/head
commit
38b54da842
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue