Skip to content

Commit

Permalink
hotfix(master): clean panic fix by lock (labring#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
cuisongliu authored Dec 13, 2021
1 parent c483628 commit 86b4f50
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions install/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,12 @@ func (s *SealosClean) Clean() {
}
if len(s.Masters) > 0 {
//2. 先删除master
lock := sync.Mutex{}
for _, master := range s.Masters {
wg.Add(1)
go func(master string) {
lock.Lock()
defer lock.Unlock()
defer wg.Done()
s.cleanMaster(master)
}(master)
Expand Down

0 comments on commit 86b4f50

Please sign in to comment.