ignore some cases that no needs to progress (#46)
Signed-off-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com> Co-authored-by: mingzhou.swx <mingzhou.swx@alibaba-inc.com>
This commit is contained in:
parent
8efe94ff58
commit
cf29580566
|
|
@ -144,6 +144,12 @@ func (r *ControllerFinder) getKruiseCloneSet(namespace string, ref *rolloutv1alp
|
|||
if _, ok = workload.Annotations[InRolloutProgressingAnnotation]; !ok {
|
||||
return workload, nil
|
||||
}
|
||||
|
||||
// no need to progress
|
||||
if cloneSet.Status.Replicas == cloneSet.Status.UpdatedReplicas && cloneSet.Status.CurrentRevision == cloneSet.Status.UpdateRevision {
|
||||
return workload, nil
|
||||
}
|
||||
|
||||
// in rollout progressing
|
||||
workload.InRolloutProgressing = true
|
||||
// Is it in rollback phase
|
||||
|
|
@ -191,6 +197,11 @@ func (r *ControllerFinder) getDeployment(namespace string, ref *rolloutv1alpha1.
|
|||
return workload, nil
|
||||
}
|
||||
|
||||
// no need to progress
|
||||
if stable.Status.Replicas == stable.Status.UpdatedReplicas {
|
||||
return workload, nil
|
||||
}
|
||||
|
||||
// in rollout progressing
|
||||
workload.InRolloutProgressing = true
|
||||
// workload is continuous release, indicates rollback(v1 -> v2 -> v1)
|
||||
|
|
@ -252,6 +263,12 @@ func (r *ControllerFinder) getStatefulSetLikeWorkload(namespace string, ref *rol
|
|||
if _, ok := workload.Annotations[InRolloutProgressingAnnotation]; !ok {
|
||||
return workload, nil
|
||||
}
|
||||
|
||||
// no need to progress
|
||||
if workloadInfo.Status.Replicas == workloadInfo.Status.UpdatedReplicas && workloadInfo.Status.StableRevision == workloadInfo.Status.UpdateRevision {
|
||||
return workload, nil
|
||||
}
|
||||
|
||||
// in rollout progressing
|
||||
workload.InRolloutProgressing = true
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue