-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Comments
Also, Basically, I need to be able to debug from an approximate pod template. |
It is not appropriate to change AttachablePodForObject (a template is not attachable). |
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. |
@smarterclayton @fabianofranz How do you think about just remove the |
Debug wants to get the closest possible pod template to what is actually
running. It does not require a running pod, it just prefers one if
possible.
…On Tue, Jul 11, 2017 at 5:53 AM, Haoran Wang ***@***.***> wrote:
@smarterclayton <https://github.com/smarterclayton> @fabianofranz
<https://github.com/fabianofranz> How do you think about just remove the
AttachablePodForObject logic here
<https://github.com/openshift/origin/blob/master/pkg/cmd/util/clientcmd/factory.go#L208-L214>
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 ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14915 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABG_p4geiOae4kAee0cVAJkxyJsnbXERks5sM0YXgaJpZM4OG5sF>
.
|
Add MostAccuratePodTemplateForObject to upstream ObjectMappingFactory, so we can always get the pod template of the upstream resources.
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. |
Debug with piped input should only succeed if the user passed a command
*AND* set --no-tty
…On Thu, Jul 13, 2017 at 5:54 AM, Haoran Wang ***@***.***> wrote:
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 fix, but I found if
we read the template from stdin, the pod can be created successfully but
the tty tunnel cannot be established, as the code here
<https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/exec.go#L235>
don't think stdin is a terminal.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14915 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABG_p6OMsLow9DF0ybMNw6cY32OW3dX_ks5sNelBgaJpZM4OG5sF>
.
|
…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
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 templateThe text was updated successfully, but these errors were encountered: