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

fix bug for image with more than one tags when create Tapp #71

Merged
merged 1 commit into from
Feb 23, 2021

Conversation

qianjun1993
Copy link
Contributor

No description provided.

@@ -1241,6 +1243,10 @@ func setInPlaceUpdateCondition(kubeclient kubernetes.Interface, pod *corev1.Pod,

// isUpdating returns true if kubelet is updating image for pod, otherwise returns false
func isUpdating(pod *corev1.Pod) bool {
isInPlaceUpdate := false
if stateStr, ok := pod.Annotations[InPlaceUpdateStateKey]; ok {
isInPlaceUpdate = (stateStr == "true")
Copy link
Contributor

Choose a reason for hiding this comment

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

这里 if (stateStr != "true") 直接就可以return false了

@@ -42,6 +42,9 @@ const (
// updateRetries is the number of Get/Update cycles we perform when an
// update fails.
updateRetries = 3

// InPlaceUpdateStateKey records whether instance is in inPlace-updating.
InPlaceUpdateStateKey string = "inPlace-update-state"
Copy link
Contributor

Choose a reason for hiding this comment

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

改成tkestack.io/inplace-update-state

@qianjun1993 qianjun1993 force-pushed the inplaceUpdate-2 branch 2 times, most recently from 0101ff7 to f885c21 Compare February 3, 2021 10:31
if ins.pod.Annotations == nil {
ins.pod.Annotations = map[string]string{}
}
ins.pod.Annotations[InPlaceUpdateStateKey] = "true"
Copy link
Contributor

Choose a reason for hiding this comment

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

这个"true"搞成一个const?

@hex108 hex108 merged commit 3436287 into tkestack:master Feb 23, 2021
@qianjun1993 qianjun1993 deleted the inplaceUpdate-2 branch December 21, 2021 02:18
# 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