@@ -33,6 +33,7 @@ import (
33
33
"github.com/golang/glog"
34
34
"github.com/spf13/cobra"
35
35
"github.com/spf13/viper"
36
+ "golang.org/x/sync/errgroup"
36
37
cmdcfg "k8s.io/minikube/cmd/minikube/cmd/config"
37
38
cmdutil "k8s.io/minikube/cmd/util"
38
39
"k8s.io/minikube/pkg/minikube/bootstrapper"
@@ -100,9 +101,13 @@ func runStart(cmd *cobra.Command, args []string) {
100
101
k8sVersion := viper .GetString (kubernetesVersion )
101
102
clusterBootstrapper := viper .GetString (cmdcfg .Bootstrapper )
102
103
104
+ var groupCacheImages errgroup.Group
103
105
if shouldCacheImages {
104
- machine .CacheImagesForBootstrapper (k8sVersion , clusterBootstrapper )
106
+ groupCacheImages .Go (func () error {
107
+ return machine .CacheImagesForBootstrapper (k8sVersion , clusterBootstrapper )
108
+ })
105
109
}
110
+
106
111
api , err := machine .NewAPIClient ()
107
112
if err != nil {
108
113
fmt .Fprintf (os .Stderr , "Error getting client: %s\n " , err )
@@ -229,7 +234,15 @@ func runStart(cmd *cobra.Command, args []string) {
229
234
glog .Errorln ("Error saving profile cluster configuration: " , err )
230
235
}
231
236
237
+ if shouldCacheImages {
238
+ fmt .Println ("Waiting for image caching to complete..." )
239
+ if err := groupCacheImages .Wait (); err != nil {
240
+ glog .Errorln ("Error caching images: " , err )
241
+ }
242
+ }
243
+
232
244
fmt .Println ("Moving files into cluster..." )
245
+
233
246
if err := k8sBootstrapper .UpdateCluster (kubernetesConfig ); err != nil {
234
247
glog .Errorln ("Error updating cluster: " , err )
235
248
cmdutil .MaybeReportErrorAndExit (err )
@@ -394,7 +407,7 @@ func init() {
394
407
startCmd .Flags ().String (containerRuntime , "" , "The container runtime to be used" )
395
408
startCmd .Flags ().String (networkPlugin , "" , "The name of the network plugin" )
396
409
startCmd .Flags ().String (featureGates , "" , "A set of key=value pairs that describe feature gates for alpha/experimental features." )
397
- startCmd .Flags ().Bool (cacheImages , true , "If true, cache docker images for the current bootstrapper and load them into the machine." )
410
+ startCmd .Flags ().Bool (cacheImages , false , "If true, cache docker images for the current bootstrapper and load them into the machine." )
398
411
startCmd .Flags ().Var (& extraOptions , "extra-config" ,
399
412
`A set of key=value pairs that describe configuration that may be passed to different components.
400
413
The key should be '.' separated, and the first part before the dot is the component to apply the configuration to.
0 commit comments