Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fig bug for imageID with more than one tags #63

Closed
wants to merge 1 commit into from

Conversation

qianjun1993
Copy link
Contributor

before updating, we find the containers will update and add their old status into the annotations of new pod。
When we find some containers that their new ImageID is same as the old and their image tag is different from the expect, we think the pod is in updating.

} else if err := json.Unmarshal([]byte(stateStr), &inPlaceUpdateState); err != nil {
klog.Warningf("Failed to unmarshal inPlaceUpdateState for pod %s/%s",
pod.Namespace, pod.Name)
//in this case, the pod is in updating?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

解析出错了就表示在updating?

}

//to find these container which will change in update and add they status before update
func getInPlaceUpdateStateJson(newPod, oldPod *corev1.Pod) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getInPlaceUpdateStateJson 这个名字看应该是要返回一个 string,但这个函数实际做的事是给newPod加了一个annotation。可以把函数改成返回(string, error),不用在这函数里给newPod设置annotation

@@ -831,7 +832,7 @@ func (c *Controller) transformPodActions(tapp *tappv1.TApp, podActions map[strin
a, getPodFullName(pod), len(availablePods), minAvailablePods)
break
}
if instance, err := newInstance(tapp, p); err == nil {
if instance, err := newInstanceWithOldStatus(tapp, p, pod); err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里改成下面的,会不会更好理解点?

if instance, err := newInstance(tapp, p); err == nil {
     err = setInplaceUpdateAnnoation(instance, pod)
     ...
}

@hex108
Copy link
Contributor

hex108 commented Feb 23, 2021

close it for because #71 is merged.

@hex108 hex108 closed this Feb 23, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants