Merge pull request #44710 from xiangpengzhao/describe-print-rc-rs-conditions

Automatic merge from submit-queue

Print conditions of RC/RS in 'kubectl describe' command

**What this PR does / why we need it**:
If conditions of RC/RS exist, print them in 'kubectl describe' command.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:


**Release note**:

```release-note
Print conditions of RC/RS in 'kubectl describe' command.
```
This commit is contained in:
Kubernetes Submit Queue 2017-04-21 07:47:29 -07:00 committed by GitHub
commit 8e3d32b141

View File

@ -1372,8 +1372,14 @@ func describeReplicationController(controller *api.ReplicationController, events
printAnnotationsMultiline(w, "Annotations", controller.Annotations)
w.Write(LEVEL_0, "Replicas:\t%d current / %d desired\n", controller.Status.Replicas, controller.Spec.Replicas)
w.Write(LEVEL_0, "Pods Status:\t%d Running / %d Waiting / %d Succeeded / %d Failed\n", running, waiting, succeeded, failed)
DescribePodTemplate(controller.Spec.Template, w)
if len(controller.Status.Conditions) > 0 {
w.Write(LEVEL_0, "Conditions:\n Type\tStatus\tReason\n")
w.Write(LEVEL_1, "----\t------\t------\n")
for _, c := range controller.Status.Conditions {
w.Write(LEVEL_1, "%v \t%v\t%v\n", c.Type, c.Status, c.Reason)
}
}
if events != nil {
DescribeEvents(events, w)
}
@ -1449,6 +1455,13 @@ func describeReplicaSet(rs *extensions.ReplicaSet, events *api.EventList, runnin
w.Write(LEVEL_0, "%d Running / %d Waiting / %d Succeeded / %d Failed\n", running, waiting, succeeded, failed)
}
DescribePodTemplate(&rs.Spec.Template, w)
if len(rs.Status.Conditions) > 0 {
w.Write(LEVEL_0, "Conditions:\n Type\tStatus\tReason\n")
w.Write(LEVEL_1, "----\t------\t------\n")
for _, c := range rs.Status.Conditions {
w.Write(LEVEL_1, "%v \t%v\t%v\n", c.Type, c.Status, c.Reason)
}
}
if events != nil {
DescribeEvents(events, w)
}