Skip to content

Commit

Permalink
Merge pull request #236 from intelligentfu8/reform
Browse files Browse the repository at this point in the history
use deepcopy for splice disshare array
  • Loading branch information
catpineapple authored Aug 29, 2024
2 parents ff2908f + 74d182b commit 03247fa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/common/utils/resource/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,10 @@ func clear_config_env_path_numbers_alwaysEquals(new *appv1.StatefulSet, old *app
nMainContainerIndex := -1
for i, c := range new.Spec.Template.Spec.Containers {
if c.Name == string(v1.Component_FE) || c.Name == string(v1.Component_BE) || c.Name == string(v1.Component_CN) || c.Name == string(v1.Component_Broker) {
newEnvs = c.Env
for _, env := range c.Env {
newEnv := env.DeepCopy()
newEnvs = append(newEnvs, *newEnv)
}
nMainContainerIndex = i
break
}
Expand Down Expand Up @@ -144,7 +147,7 @@ func clear_config_env_path_numbers_alwaysEquals(new *appv1.StatefulSet, old *app
newEnvs = append(newEnvs[:index], lastEnvs...)
}
}

if len(newEnvs) != len(oldEnvs) {
return false
} else {
Expand Down

0 comments on commit 03247fa

Please sign in to comment.