Skip to content

Commit

Permalink
break the loop when we find the current revision (#887)
Browse files Browse the repository at this point in the history
Signed-off-by: shiyan2016 <[email protected]>
  • Loading branch information
shiyan2016 authored Jan 13, 2022
1 parent 580a944 commit 2eece61
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/controller/cloneset/cloneset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ func (r *ReconcileCloneSet) getActiveRevisions(cs *appsv1alpha1.CloneSet, revisi
for i := range revisions {
if revisions[i].Name == cs.Status.CurrentRevision {
currentRevision = revisions[i]
break
}
}

Expand Down
1 change: 1 addition & 0 deletions pkg/controller/statefulset/stateful_set_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ func (ssc *defaultStatefulSetControl) getStatefulSetRevisions(
for i := range revisions {
if revisions[i].Name == set.Status.CurrentRevision {
currentRevision = revisions[i]
break
}
}

Expand Down
1 change: 1 addition & 0 deletions pkg/controller/uniteddeployment/revision.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func (r *ReconcileUnitedDeployment) constructUnitedDeploymentRevisions(ud *appsa
for i := range revisions {
if revisions[i].Name == ud.Status.CurrentRevision {
currentRevision = revisions[i]
break
}
}

Expand Down

0 comments on commit 2eece61

Please sign in to comment.