Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oc get projectrequests -o yaml panics #16064

Closed
enj opened this issue Aug 30, 2017 · 1 comment
Closed

oc get projectrequests -o yaml panics #16064

enj opened this issue Aug 30, 2017 · 1 comment
Assignees
Labels
component/cli kind/bug Categorizes issue or PR as related to a bug. priority/P0
Milestone

Comments

@enj
Copy link
Contributor

enj commented Aug 30, 2017

$ oc get projectrequests -o yaml |& pp
panic: interface conversion: runtime.Object is *v1.Status, not *unstructured.Unstructured


To see all goroutines, visit https://github.com/maruel/panicparse#GOTRACEBACK

1: running
    cmd   get.go:356     RunGet(0x6e9ef60, 0xc4204d89f0, #1, 0xc42000e018, #1, #2, #6, #4, 0x1, 0x3, ...)
    cmd   get.go:121     NewCmdGet.func1(Factory(#6), Writer(0x1))
    cobra command.go:603 (*Command).execute(*Command(#6), []string(#3 len=3 cap=3), #6, #3)
    cobra command.go:689 (*Command).ExecuteC(*Command(#5), #2, #5, 0x4)
    cobra command.go:648 (*Command).Execute(*Command(#5), 0x2, #5)
    main  oc.go:36       main()
@enj enj added component/cli kind/bug Categorizes issue or PR as related to a bug. labels Aug 30, 2017
@enj enj added this to the 3.7.0 milestone Aug 30, 2017
@juanvallejo
Copy link
Contributor

@fabianofranz this one is a bit tricky since, right now, the get cmd assumes that all lists of infos returned from the resource builder are *unstructured.Unstructured. When it comes across a runtime.Object that does not convert to *unstructured.Unstructured, this panic happens.

Will look more into this, but any ideas on how to fix this are welcome. I was thinking maybe return an error if at least one item is found that cannot be converted?

openshift-merge-robot added a commit that referenced this issue Sep 9, 2017
…ed-objects-before-composing

Automatic merge from submit-queue

UPSTREAM: 51727: ensure oc get deals with unstructured resources

Fixes #16064
Addresses BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1487245

`$ oc get ...` assumed all resources returned from a resource builder were unstructured objects.
This patch ensures we are dealing with unstructured objects before attempting to
compose into an unstructured list.

cc @openshift/cli-review @enj
k8s-github-robot pushed a commit to kubernetes/kubernetes that referenced this issue Sep 23, 2017
…ed-objects-kubectl-get

Automatic merge from submit-queue (batch tested with PRs 51031, 51705, 51888, 51727, 51684). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>..

ensure unstructured resources in kubectl get

Related downstream issue: openshift/origin#16064

Ensure we are dealing with unstructured objects before attempting to
compose into an unstructured list.

`$ kubectl get ...` [assumes all resources returned from a resource builder are unstructured objects](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/get.go#L355). This leads to a panic when dealing with non-unstructured objects.
This patch ensures we are dealing with unstructured objects before attempting to
compose into an unstructured list.

**Release note**:
```release-note
NONE
```

cc @fabianofranz @kubernetes/sig-cli-misc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/cli kind/bug Categorizes issue or PR as related to a bug. priority/P0
Projects
None yet
Development

No branches or pull requests

4 participants