Skip to content

Commit

Permalink
add lock, fix list deployment bug (#331)
Browse files Browse the repository at this point in the history
* add lock, fix list deployment bug

* add changelog
  • Loading branch information
tiancandevloper authored Aug 23, 2023
1 parent 0ce7e55 commit fe25b8d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
19 changes: 19 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# v1.8.7

## BugFix
- fix list deployment bug [#331](https://github.com/kubecube-io/KubeCube/pull/331)

## Dependencies

- hnc v1.0
- nginx-ingress v0.46.0
- helm 3.5
- metrics-server v0.4.1
- elasticsearch 7.8
- kubecube-monitoring 15.4.8
- thanos 3.18.0
- logseer v1.0.0
- logagent v1.0.0
- kubecube-audit v1.2.0
- kubecube-webconsole v1.2.4

# v1.8.6

## BugFix
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,15 @@ func (d *Deployment) getExtendDeployments() (*unstructured.Unstructured, *errcod
}

func (d *Deployment) addExtendInfo(deploymentList appsv1.DeploymentList) []ExtentDeployment {
resultList := make([]ExtentDeployment, 0)
resultList := make([]ExtentDeployment, len(deploymentList.Items))
wg := &sync.WaitGroup{}
for _, deployment := range deploymentList.Items {
for i, deployment := range deploymentList.Items {
wg.Add(1)
deployment := deployment
go func() {
result := d.getDeployExtendInfo(deployment)
resultList = append(resultList, result)
go func(i int, deploy appsv1.Deployment) {
result := d.getDeployExtendInfo(deploy)
resultList[i] = result
wg.Done()
}()
}(i, deployment)
}
wg.Wait()
return resultList
Expand Down

0 comments on commit fe25b8d

Please sign in to comment.