List RSes once when getting old/new RSes in deployment e2e tests

This commit is contained in:
Janet Kuo
2016-06-01 14:14:40 -07:00
parent 06f742a5ea
commit 2ced966cd5
5 changed files with 52 additions and 36 deletions

View File

@@ -1922,12 +1922,9 @@ func (dd *DeploymentDescriber) Describe(namespace, name string, describerSetting
ru := d.Spec.Strategy.RollingUpdate
fmt.Fprintf(out, "RollingUpdateStrategy:\t%s max unavailable, %s max surge\n", ru.MaxUnavailable.String(), ru.MaxSurge.String())
}
oldRSs, _, err := deploymentutil.GetOldReplicaSets(d, dd)
oldRSs, _, newRS, err := deploymentutil.GetAllReplicaSets(d, dd)
if err == nil {
fmt.Fprintf(out, "OldReplicaSets:\t%s\n", printReplicaSetsByLabels(oldRSs))
}
newRS, err := deploymentutil.GetNewReplicaSet(d, dd)
if err == nil {
var newRSs []*extensions.ReplicaSet
if newRS != nil {
newRSs = append(newRSs, newRS)