Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken build due to bad merge: restore waitCacheImages function. #4082

Merged
merged 1 commit into from
Apr 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,7 @@ func runStart(cmd *cobra.Command, args []string) {
cr := configureRuntimes(host, runner)

// prepareHostEnvironment uses the downloaded images, so we need to wait for background task completion.
if viper.GetBool(cacheImages) {
console.OutStyle("waiting", "Waiting for image downloads to complete ...")
if err := cacheGroup.Wait(); err != nil {
glog.Errorln("Error caching images: ", err)
}
}
waitCacheImages(&cacheGroup)

bs := prepareHostEnvironment(m, config.KubernetesConfig)

Expand Down Expand Up @@ -294,6 +289,17 @@ func beginCacheImages(g *errgroup.Group, k8sVersion string) {
})
}

// waitCacheImages blocks until the image cache jobs complete
func waitCacheImages(g *errgroup.Group) {
if !viper.GetBool(cacheImages) {
return
}
console.OutStyle("waiting", "Waiting for image downloads to complete ...")
if err := g.Wait(); err != nil {
glog.Errorln("Error caching images: ", err)
}
}

// generateConfig generates cfg.Config based on flags and supplied arguments
func generateConfig(cmd *cobra.Command, k8sVersion string) (cfg.Config, error) {
r, err := cruntime.New(cruntime.Config{Type: viper.GetString(containerRuntime)})
Expand Down