-
Notifications
You must be signed in to change notification settings - Fork 37
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
Conversation
pkg/tapp/controller.go
Outdated
@@ -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") |
There was a problem hiding this comment.
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了
pkg/tapp/instance.go
Outdated
@@ -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" |
There was a problem hiding this comment.
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
?
0101ff7
to
f885c21
Compare
pkg/tapp/instance.go
Outdated
if ins.pod.Annotations == nil { | ||
ins.pod.Annotations = map[string]string{} | ||
} | ||
ins.pod.Annotations[InPlaceUpdateStateKey] = "true" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个"true"搞成一个const?
f885c21
to
f21f011
Compare
f21f011
to
60bd985
Compare
No description provided.