Skip to content

Commit

Permalink
add namespace logging on clear results
Browse files Browse the repository at this point in the history
  • Loading branch information
emirozer committed Aug 26, 2019
1 parent 125bdcd commit 1ea73a0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/plugin/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ func (o *DoctorOptions) Run() error {
}
if len(odeploymentTriage.Anomalies) > 0 {
log.WithFields(log.Fields{"resource": odeploymentTriage.ResourceType, "Anomalies": odeploymentTriage.Anomalies}).Warn(odeploymentTriage.AnomalyType)
} else {
log.Info("No orphaned deployments detected! namespace: ", ns)
}

ldeploymentTriage, err := triage.LeftOverDeployments(o.KubeCli, ns)
Expand All @@ -229,6 +231,8 @@ func (o *DoctorOptions) Run() error {
}
if len(ldeploymentTriage.Anomalies) > 0 {
log.WithFields(log.Fields{"resource": ldeploymentTriage.ResourceType, "Anomalies": ldeploymentTriage.Anomalies}).Warn(ldeploymentTriage.AnomalyType)
} else {
log.Info("No leftover deployments detected! namespace: ", ns)
}

}
Expand All @@ -245,13 +249,17 @@ func (o *DoctorOptions) Run() error {
}
if len(orsTriage.Anomalies) > 0 {
log.WithFields(log.Fields{"resource": orsTriage.ResourceType, "Anomalies": orsTriage.Anomalies}).Warn(orsTriage.AnomalyType)
} else {
log.Info("No orphaned replica sets detected! namespace: ", ns)
}
lrsTriage, err := triage.LeftOverReplicaSet(o.KubeCli, ns)
if err != nil {
return err
}
if len(lrsTriage.Anomalies) > 0 {
log.WithFields(log.Fields{"resource": lrsTriage.ResourceType, "Anomalies": lrsTriage.Anomalies}).Warn(lrsTriage.AnomalyType)
} else {
log.Info("No leftover replica sets detected! namespace: ", ns)
}
}

Expand All @@ -267,6 +275,8 @@ func (o *DoctorOptions) Run() error {
}
if len(jobsTriage.Anomalies) > 0 {
log.WithFields(log.Fields{"resource": jobsTriage.ResourceType, "Anomalies": jobsTriage.Anomalies}).Warn(jobsTriage.AnomalyType)
} else {
log.Info("No leftover cronjobs detected! namespace: ", ns)
}
}
// triage jobs end
Expand Down

0 comments on commit 1ea73a0

Please sign in to comment.