Skip to content

Commit

Permalink
Merge pull request #7394 from priyawadhwa/parallel
Browse files Browse the repository at this point in the history
parallelize updating cluster and setting up certs
  • Loading branch information
tstromberg authored Apr 3, 2020
2 parents 294d181 + 60fde94 commit 44f1b4c
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions pkg/minikube/node/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os/exec"
"strconv"
"strings"
"sync"
"time"

"github.com/blang/semver"
Expand Down Expand Up @@ -239,12 +240,24 @@ func setupKubeAdm(mAPI libmachine.API, cfg config.ClusterConfig, n config.Node)
out.T(out.Option, "{{.extra_option_component_name}}.{{.key}}={{.value}}", out.V{"extra_option_component_name": eo.Component, "key": eo.Key, "value": eo.Value})
}
// Loads cached images, generates config files, download binaries
if err := bs.UpdateCluster(cfg); err != nil {
exit.WithError("Failed to update cluster", err)
}
if err := bs.SetupCerts(cfg.KubernetesConfig, n); err != nil {
exit.WithError("Failed to setup certs", err)
}
// update cluster and set up certs in parallel
var parallel sync.WaitGroup
parallel.Add(2)
go func() {
if err := bs.UpdateCluster(cfg); err != nil {
exit.WithError("Failed to update cluster", err)
}
parallel.Done()
}()

go func() {
if err := bs.SetupCerts(cfg.KubernetesConfig, n); err != nil {
exit.WithError("Failed to setup certs", err)
}
parallel.Done()
}()

parallel.Wait()
return bs
}

Expand Down

0 comments on commit 44f1b4c

Please sign in to comment.