Print old replicasets even if there is no new replicaset
Fixes
@@ -2,7 +2,6 @@ package overview
import (
"context"
- "log"
"reflect"
"sort"
@@ -66,14 +65,12 @@ func (drs *DeploymentReplicaSets) Content(ctx context.Context, object runtime.Ob
deployment, err := retrieveDeployment(object)
if err != nil {
- log.Printf("wtf: %v", err)
- return nil, err
+ return nil, errors.Wrap(err, "retrieving deployment")
}
replicaSetContent, err := drs.replicaSets(deployment, c)
if err != nil {
- log.Printf("wtf2: %v", err)
- return nil, err
+ return nil, errors.Wrap(err, "rendering replicasets")
}
contents = append(contents, replicaSetContent...)
@@ -90,6 +87,7 @@ func (drs *DeploymentReplicaSets) replicaSets(deployment *extensions.Deployment,
newReplicaSet := findNewReplicaSet(deployment, replicaSets)
+ if newReplicaSet != nil {
err = printContentObject(
"New Replica Set",
"",
@@ -101,6 +99,7 @@ func (drs *DeploymentReplicaSets) replicaSets(deployment *extensions.Deployment,
if err != nil {
return nil, errors.Wrap(err, "unable to print new replica set")
}
+ }
oldList := &extensions.ReplicaSetList{}
for _, rs := range findOldReplicaSets(deployment, replicaSets) {
