Add more logs during the cleanup phase of a deployment

This commit is contained in:
Michail Kargakis
2017-02-09 10:29:41 +01:00
parent d953402cdf
commit ff83eb58eb
2 changed files with 14 additions and 2 deletions

View File

@@ -547,6 +547,7 @@ func (dc *DeploymentController) cleanupDeployment(oldRSs []*extensions.ReplicaSe
}
sort.Sort(controller.ReplicaSetsByCreationTimestamp(oldRSs))
glog.V(2).Infof("Looking to cleanup old replica sets for deployment %q", deployment.Name)
var errList []error
// TODO: This should be parallelized.
@@ -556,6 +557,7 @@ func (dc *DeploymentController) cleanupDeployment(oldRSs []*extensions.ReplicaSe
if rs.Status.Replicas != 0 || *(rs.Spec.Replicas) != 0 || rs.Generation > rs.Status.ObservedGeneration {
continue
}
glog.V(2).Infof("Trying to cleanup replica set %q for deployment %q", rs.Name, deployment.Name)
if err := dc.client.Extensions().ReplicaSets(rs.Namespace).Delete(rs.Name, nil); err != nil && !errors.IsNotFound(err) {
glog.V(2).Infof("Failed deleting old replica set %v for deployment %v: %v", rs.Name, deployment.Name, err)
errList = append(errList, err)