Skip to content

Commit

Permalink
Merge pull request #81 from qianjun1993/bug-fix
Browse files Browse the repository at this point in the history
fix bug for map
  • Loading branch information
hex108 authored Oct 21, 2021
2 parents 99fb971 + 80595a1 commit b2799b5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pkg/tapp/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,16 +393,17 @@ func (c *Controller) Sync(key string) error {
if err != nil {
return err
}
tapp, err := c.tappLister.TApps(namespace).Get(name)
curTapp, err := c.tappLister.TApps(namespace).Get(name)
if errors.IsNotFound(err) {
klog.Infof("TApp has been deleted %v", key)
return nil
}
if err != nil {
klog.Errorf("Unable to retrieve tapp %s from store: %v", util.GetTAppFullName(tapp), err)
klog.Errorf("Unable to retrieve tapp %s from store: %v", util.GetTAppFullName(curTapp), err)
return err
}

tapp := curTapp.DeepCopy()
err = c.preprocessTApp(tapp)
if err != nil {
klog.Errorf("Failed to preprocess tapp %s: %v", util.GetTAppFullName(tapp), err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/tapp/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ func (p *ApiServerInstanceClient) Update(current *Instance, expected *Instance)

var err, e error
pod := current.pod
for i, cp := 0, current.pod; i <= updateRetries; i++ {
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)

Expand Down

0 comments on commit b2799b5

Please sign in to comment.