mirror of https://github.com/k3s-io/k3s
kubectl: display ready replicas in 'get {rs,rc}'
parent
878e06a71c
commit
51a894e616
|
@ -421,6 +421,7 @@ func Example_printReplicationControllerWithNamespace() {
|
|||
},
|
||||
Status: api.ReplicationControllerStatus{
|
||||
Replicas: 1,
|
||||
ReadyReplicas: 1,
|
||||
},
|
||||
}
|
||||
mapper, _ := f.Object(false)
|
||||
|
@ -429,8 +430,8 @@ func Example_printReplicationControllerWithNamespace() {
|
|||
fmt.Printf("Unexpected error: %v", err)
|
||||
}
|
||||
// Output:
|
||||
// NAMESPACE NAME DESIRED CURRENT AGE
|
||||
// beep foo 1 1 10y
|
||||
// NAMESPACE NAME DESIRED CURRENT READY AGE
|
||||
// beep foo 1 1 1 10y
|
||||
}
|
||||
|
||||
func Example_printMultiContainersReplicationControllerWithWide() {
|
||||
|
@ -481,8 +482,8 @@ func Example_printMultiContainersReplicationControllerWithWide() {
|
|||
fmt.Printf("Unexpected error: %v", err)
|
||||
}
|
||||
// Output:
|
||||
// NAME DESIRED CURRENT AGE CONTAINER(S) IMAGE(S) SELECTOR
|
||||
// foo 1 1 10y foo,foo2 someimage,someimage2 foo=bar
|
||||
// NAME DESIRED CURRENT READY AGE CONTAINER(S) IMAGE(S) SELECTOR
|
||||
// foo 1 1 0 10y foo,foo2 someimage,someimage2 foo=bar
|
||||
}
|
||||
|
||||
func Example_printReplicationController() {
|
||||
|
@ -532,8 +533,8 @@ func Example_printReplicationController() {
|
|||
fmt.Printf("Unexpected error: %v", err)
|
||||
}
|
||||
// Output:
|
||||
// NAME DESIRED CURRENT AGE
|
||||
// foo 1 1 10y
|
||||
// NAME DESIRED CURRENT READY AGE
|
||||
// foo 1 1 0 10y
|
||||
}
|
||||
|
||||
func Example_printPodWithWideFormat() {
|
||||
|
|
|
@ -458,8 +458,8 @@ func (h *HumanReadablePrinter) FinishPrint(output io.Writer, res string) error {
|
|||
// pkg/kubectl/cmd/get.go to reflect the new resource type.
|
||||
var podColumns = []string{"NAME", "READY", "STATUS", "RESTARTS", "AGE"}
|
||||
var podTemplateColumns = []string{"TEMPLATE", "CONTAINER(S)", "IMAGE(S)", "PODLABELS"}
|
||||
var replicationControllerColumns = []string{"NAME", "DESIRED", "CURRENT", "AGE"}
|
||||
var replicaSetColumns = []string{"NAME", "DESIRED", "CURRENT", "AGE"}
|
||||
var replicationControllerColumns = []string{"NAME", "DESIRED", "CURRENT", "READY", "AGE"}
|
||||
var replicaSetColumns = []string{"NAME", "DESIRED", "CURRENT", "READY", "AGE"}
|
||||
var jobColumns = []string{"NAME", "DESIRED", "SUCCESSFUL", "AGE"}
|
||||
var scheduledJobColumns = []string{"NAME", "SCHEDULE", "SUSPEND", "ACTIVE", "LAST-SCHEDULE"}
|
||||
var serviceColumns = []string{"NAME", "CLUSTER-IP", "EXTERNAL-IP", "PORT(S)", "AGE"}
|
||||
|
@ -834,10 +834,12 @@ func printReplicationController(controller *api.ReplicationController, w io.Writ
|
|||
|
||||
desiredReplicas := controller.Spec.Replicas
|
||||
currentReplicas := controller.Status.Replicas
|
||||
if _, err := fmt.Fprintf(w, "%s\t%d\t%d\t%s",
|
||||
readyReplicas := controller.Status.ReadyReplicas
|
||||
if _, err := fmt.Fprintf(w, "%s\t%d\t%d\t%d\t%s",
|
||||
name,
|
||||
desiredReplicas,
|
||||
currentReplicas,
|
||||
readyReplicas,
|
||||
translateTimestamp(controller.CreationTimestamp),
|
||||
); err != nil {
|
||||
return err
|
||||
|
@ -884,10 +886,12 @@ func printReplicaSet(rs *extensions.ReplicaSet, w io.Writer, options PrintOption
|
|||
|
||||
desiredReplicas := rs.Spec.Replicas
|
||||
currentReplicas := rs.Status.Replicas
|
||||
if _, err := fmt.Fprintf(w, "%s\t%d\t%d\t%s",
|
||||
readyReplicas := rs.Status.ReadyReplicas
|
||||
if _, err := fmt.Fprintf(w, "%s\t%d\t%d\t%d\t%s",
|
||||
name,
|
||||
desiredReplicas,
|
||||
currentReplicas,
|
||||
readyReplicas,
|
||||
translateTimestamp(rs.CreationTimestamp),
|
||||
); err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in New Issue