Do not cleanup replicasets already marked for deletion

This commit is contained in:
Michail Kargakis
2017-02-09 10:30:32 +01:00
parent ff83eb58eb
commit 97c9e7fe07
2 changed files with 13 additions and 1 deletions

View File

@@ -554,7 +554,7 @@ func (dc *DeploymentController) cleanupDeployment(oldRSs []*extensions.ReplicaSe
for i := int32(0); i < diff; i++ {
rs := oldRSs[i]
// Avoid delete replica set with non-zero replica counts
if rs.Status.Replicas != 0 || *(rs.Spec.Replicas) != 0 || rs.Generation > rs.Status.ObservedGeneration {
if rs.Status.Replicas != 0 || *(rs.Spec.Replicas) != 0 || rs.Generation > rs.Status.ObservedGeneration || rs.DeletionTimestamp != nil {
continue
}
glog.V(2).Infof("Trying to cleanup replica set %q for deployment %q", rs.Name, deployment.Name)