Skip to content

Commit

Permalink
fix(region): panic occured when removing post overlay
Browse files Browse the repository at this point in the history
  • Loading branch information
zexi committed Jan 21, 2025
1 parent 3e96ee5 commit 8712735
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/compute/models/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1175,11 +1175,14 @@ func (c *SContainer) PerformRemoveVolumeMountPostOverlay(ctx context.Context, us

func (c *SContainer) removePostOverlay(vmd *apis.ContainerVolumeMountDisk, ov *apis.ContainerVolumeMountDiskPostOverlay) *apis.ContainerVolumeMountDisk {
curOvs := vmd.PostOverlay
for i, cov := range curOvs {
resultOvs := []*apis.ContainerVolumeMountDiskPostOverlay{}
for i := range curOvs {
cov := curOvs[i]
if cov.IsEqual(*ov) {
curOvs = append(curOvs[:i], curOvs[i+1:]...)
continue
}
resultOvs = append(resultOvs, cov)
}
vmd.PostOverlay = curOvs
vmd.PostOverlay = resultOvs
return vmd
}

0 comments on commit 8712735

Please sign in to comment.