Skip to content

Commit

Permalink
fix pod hang in PreparingUpdate state when rollback before update hook
Browse files Browse the repository at this point in the history
Signed-off-by: shiyan2016 <shiyan20160606@gmail.com>
  • Loading branch information
shiyan2016 committed Jan 5, 2023
1 parent bab1a31 commit d0081e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/controller/cloneset/sync/cloneset_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (c *realControl) refreshPodState(cs *appsv1alpha1.CloneSet, coreControl clo
lifecycle.IsPodAllHooked(cs.Spec.Lifecycle.PreNormal, pod) {
state = appspub.LifecycleStateNormal
}
case appspub.LifecycleStateUpdating:
case appspub.LifecycleStatePreparingUpdate, appspub.LifecycleStateUpdating:
if opts.CheckPodUpdateCompleted(pod) == nil {
if cs.Spec.Lifecycle != nil && !lifecycle.IsPodAllHooked(cs.Spec.Lifecycle.InPlaceUpdate, pod) {
state = appspub.LifecycleStateUpdated
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/statefulset/stateful_set_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ func (ssc *defaultStatefulSetControl) refreshPodState(set *appsv1beta1.StatefulS

var state appspub.LifecycleStateType
switch lifecycle.GetPodLifecycleState(pod) {
case appspub.LifecycleStateUpdating:
case appspub.LifecycleStatePreparingUpdate, appspub.LifecycleStateUpdating:
if opts.CheckPodUpdateCompleted(pod) == nil {
if set.Spec.Lifecycle != nil && !lifecycle.IsPodAllHooked(set.Spec.Lifecycle.InPlaceUpdate, pod) {
state = appspub.LifecycleStateUpdated
Expand Down

0 comments on commit d0081e6

Please sign in to comment.