Fix: deepcopy before mutating shared objects

Signed-off-by: dkeven <keven@kubesphere.io>
This commit is contained in:
dkeven
2022-01-07 18:00:26 +08:00
parent e1df8bc5bb
commit d1b0beffd6
7 changed files with 81 additions and 32 deletions

View File

@@ -91,6 +91,7 @@ func (s *storageClassesSearcher) Search(namespace string, conditions *params.Con
r := make([]interface{}, 0)
for _, i := range result {
i = i.DeepCopy()
count := s.countPersistentVolumeClaims(i.Name)
if i.Annotations == nil {
i.Annotations = make(map[string]string)