Skip to content

Commit

Permalink
Merge pull request kubernetes#34299 from jessfraz/automated-cherry-pi…
Browse files Browse the repository at this point in the history
…ck-of-#33794-kubernetes#33610-origin-release-1.4

Automatic merge from submit-queue

Automated cherry pick of kubernetes#33794 kubernetes#33610 origin release 1.4

Cherry pick of kubernetes#33794 kubernetes#33610 on release-1.4.

kubernetes#33794: Enable kubectl describe rs to work when apiserver does not
kubernetes#33610: Increase tineout for federated ingress test.
  • Loading branch information
Kubernetes Submit Queue authored Oct 7, 2016
2 parents e509373 + d9ab7e6 commit 0487e29
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions pkg/kubectl/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -1169,28 +1169,30 @@ func (d *ReplicaSetDescriber) Describe(namespace, name string, describerSettings
return "", err
}

running, waiting, succeeded, failed, err := getPodStatusForController(pc, selector)
if err != nil {
return "", err
}
running, waiting, succeeded, failed, getPodErr := getPodStatusForController(pc, selector)

var events *api.EventList
if describerSettings.ShowEvents {
events, _ = d.Events(namespace).Search(rs)
}

return describeReplicaSet(rs, events, running, waiting, succeeded, failed)
return describeReplicaSet(rs, events, running, waiting, succeeded, failed, getPodErr)
}

func describeReplicaSet(rs *extensions.ReplicaSet, events *api.EventList, running, waiting, succeeded, failed int) (string, error) {
func describeReplicaSet(rs *extensions.ReplicaSet, events *api.EventList, running, waiting, succeeded, failed int, getPodErr error) (string, error) {
return tabbedString(func(out io.Writer) error {
fmt.Fprintf(out, "Name:\t%s\n", rs.Name)
fmt.Fprintf(out, "Namespace:\t%s\n", rs.Namespace)
fmt.Fprintf(out, "Image(s):\t%s\n", makeImageList(&rs.Spec.Template.Spec))
fmt.Fprintf(out, "Selector:\t%s\n", unversioned.FormatLabelSelector(rs.Spec.Selector))
printLabelsMultiline(out, "Labels", rs.Labels)
fmt.Fprintf(out, "Replicas:\t%d current / %d desired\n", rs.Status.Replicas, rs.Spec.Replicas)
fmt.Fprintf(out, "Pods Status:\t%d Running / %d Waiting / %d Succeeded / %d Failed\n", running, waiting, succeeded, failed)
fmt.Fprintf(out, "Pods Status:\t")
if getPodErr != nil {
fmt.Fprintf(out, "error in fetching pods: %s\n", getPodErr)
} else {
fmt.Fprintf(out, "%d Running / %d Waiting / %d Succeeded / %d Failed\n", running, waiting, succeeded, failed)
}
describeVolumes(rs.Spec.Template.Spec.Volumes, out, "")
if events != nil {
DescribeEvents(events, out)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/federated-ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import (

const (
MaxRetriesOnFederatedApiserver = 3
FederatedIngressTimeout = 60 * time.Second
FederatedIngressTimeout = 120 * time.Second
FederatedIngressName = "federated-ingress"
FederatedIngressServiceName = "federated-ingress-service"
FederatedIngressServicePodName = "federated-ingress-service-test-pod"
Expand Down

0 comments on commit 0487e29

Please sign in to comment.