未验证 提交 fba4de74 编写于 作者: T Thomas Strömberg 提交者: GitHub

Merge pull request #8787 from saltbo/master

fix error usage for the WaitGroup in the pkg addons
...@@ -353,7 +353,6 @@ func verifyAddonStatusInternal(cc *config.ClusterConfig, name string, val string ...@@ -353,7 +353,6 @@ func verifyAddonStatusInternal(cc *config.ClusterConfig, name string, val string
// Start enables the default addons for a profile, plus any additional // Start enables the default addons for a profile, plus any additional
func Start(wg *sync.WaitGroup, cc *config.ClusterConfig, toEnable map[string]bool, additional []string) { func Start(wg *sync.WaitGroup, cc *config.ClusterConfig, toEnable map[string]bool, additional []string) {
wg.Add(1)
defer wg.Done() defer wg.Done()
start := time.Now() start := time.Now()
......
...@@ -130,7 +130,8 @@ func TestStart(t *testing.T) { ...@@ -130,7 +130,8 @@ func TestStart(t *testing.T) {
} }
var wg sync.WaitGroup var wg sync.WaitGroup
Start(&wg, cc, map[string]bool{}, []string{"dashboard"}) wg.Add(1)
go Start(&wg, cc, map[string]bool{}, []string{"dashboard"})
wg.Wait() wg.Wait()
if !assets.Addons["dashboard"].IsEnabled(cc) { if !assets.Addons["dashboard"].IsEnabled(cc) {
......
...@@ -148,6 +148,7 @@ func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) { ...@@ -148,6 +148,7 @@ func Start(starter Starter, apiServer bool) (*kubeconfig.Settings, error) {
// enable addons, both old and new! // enable addons, both old and new!
if starter.ExistingAddons != nil { if starter.ExistingAddons != nil {
wg.Add(1)
go addons.Start(&wg, starter.Cfg, starter.ExistingAddons, config.AddonList) go addons.Start(&wg, starter.Cfg, starter.ExistingAddons, config.AddonList)
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册