Skip to content

Commit

Permalink
Merge pull request tkestack#83 from qianjun1993/fix
Browse files Browse the repository at this point in the history
fix bug for map
  • Loading branch information
hex108 authored Jan 10, 2022
2 parents b2799b5 + 6c40952 commit 8ad6fff
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/tapp/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,15 +442,16 @@ func (p *ApiServerInstanceClient) Update(current *Instance, expected *Instance)

var err, e error
pod := current.pod
for i, cp := 0, current.pod.DeepCopy(); i <= updateRetries; i++ {
mergePod(cp, expected.pod)
klog.V(2).Infof("Updating pod %s, pod meta:%+v, pod spec:%+v", getPodFullName(cp), cp.ObjectMeta, cp.Spec)
for i, cp := 0, current.pod; i <= updateRetries; i++ {
cpCopy := cp.DeepCopy()
mergePod(cpCopy, expected.pod)
klog.V(2).Infof("Updating pod %s, pod meta:%+v, pod spec:%+v", getPodFullName(cpCopy), cpCopy.ObjectMeta, cpCopy.Spec)

_, err = podClient(p.KubeClient, ns).Update(cp)
_, err = podClient(p.KubeClient, ns).Update(cpCopy)
if err == nil {
break
}
klog.Errorf("Failed to update pod %s, will retry: %v", getPodFullName(cp), err)
klog.Errorf("Failed to update pod %s, will retry: %v", getPodFullName(cpCopy), err)

if cp, e = p.podLister.Pods(ns).Get(pod.Name); e != nil {
break
Expand Down

0 comments on commit 8ad6fff

Please sign in to comment.