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 debug should not use AttachablePodForObject #14915

Closed
smarterclayton opened this issue Jun 27, 2017 · 7 comments
Closed

oc debug should not use AttachablePodForObject #14915

smarterclayton opened this issue Jun 27, 2017 · 7 comments
Assignees
Labels
component/cli kind/bug Categorizes issue or PR as related to a bug. priority/P2

Comments

@smarterclayton
Copy link
Contributor

Debug doesn't work against attachable pod for object because a scaled to zero Deployment (required for us to be able to debug and mount an RWO) hangs forever.

We should be using a different method MostAccuratePodTemplateForObject which should try to go as far down as it can and then return back a pod template, and if there are zero pods return the RS template

@smarterclayton
Copy link
Contributor Author

Also, oc get deploy/prometheus -o yaml | oc debug --one-container -c prometheus -f - fails.

Basically, I need to be able to debug from an approximate pod template.

@smarterclayton
Copy link
Contributor Author

It is not appropriate to change AttachablePodForObject (a template is not attachable).

@smarterclayton
Copy link
Contributor Author

And this is actually a pretty common use case - you want to debug something with RWO. You scale it to zero (because otherwise you have to fight for the RWO). You then want to run debug on it.

@wanghaoran1988
Copy link
Member

@smarterclayton @fabianofranz How do you think about just remove the AttachablePodForObject logic here and use the t.spec.Template directly? I am not very clear why we need carbon copy an existed pod instead of using the t.spec.Template, would you please tell me the logic behind this ?

@smarterclayton
Copy link
Contributor Author

smarterclayton commented Jul 11, 2017 via email

@wanghaoran1988
Copy link
Member

wanghaoran1988 commented Jul 13, 2017

Add MostAccuratePodTemplateForObject to upstream ObjectMappingFactory, so we can always get the pod template of the upstream resources.

Also, oc get deploy/prometheus -o yaml | oc debug --one-container -c prometheus -f - fails.
Basically, I need to be able to debug from an approximate pod template.

For this kind debug, template from stdin, I am try to get it work, but I found if we read the template from stdin, the debug pod can be created successfully but the tty tunnel cannot be established, as the code here don't think stdin is a terminal.

@smarterclayton
Copy link
Contributor Author

smarterclayton commented Jul 13, 2017 via email

openshift-merge-robot added a commit that referenced this issue Oct 25, 2017
…oyment-w-0-replicas

Automatic merge from submit-queue.

UPSTREAM: 53606: use deployment pod template if 0 replicas

Fixes #14286
Fixes #14915

Prevent `oc debug` from hanging indefinitely when dealing
with a deployment that has been scaled down to 0.

cc @openshift/cli-review @smarterclayton
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/P2
Projects
None yet
Development

No branches or pull requests

5 participants