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
Bug 1779331: Fix a number of issues around debugging daemonset pods and init containers #166
Bug 1779331: Fix a number of issues around debugging daemonset pods and init containers #166
Conversation
When using `oc debug istag/foo:bar` it is not uncommon to want to create the debug pod in another namespace. Make that possible by adding `--to-namespace` which overrides the pod namespace.
The implication of --one-container is that we only want a single container.
We only printed the regular container names.
If a user specifies an init container, we have to preserve it even if `--keep-init-containers=false` is set. In that case, we strip all other init containers.
If there is a host port set, clear it. If this is a host network pod, clear all ports. This allows us to debug a pod on the same node for daemonsets that declare host network or host pods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest looks reasonable, but why --to-namespace
?
@@ -362,6 +364,9 @@ func (o *DebugOptions) RunDebug() error { | |||
if len(ns) == 0 { | |||
ns = o.Namespace | |||
} | |||
if len(o.ToNamespace) > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this different from explicitly using --namespace
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example is:
oc debug istag/cli:latest -n openshift —to-namespace=my-test-ns
For when you don’t have write access in the namespace that contains the thing you want to debug.
Any other comments? |
@soltysh I want this in 4.3, so if you have any other comments let me know soon |
nope, this is good |
@soltysh: once the present PR merges, I will cherry-pick it on top of release-4.3 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: smarterclayton, soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest Please review the full test history for this PR and help us cut down flakes. |
/cherry-pick release-4.3 |
@smarterclayton: once the present PR merges, I will cherry-pick it on top of release-4.3 in a new PR and assign it to you. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@smarterclayton: This pull request references Bugzilla bug 1779331, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest Please review the full test history for this PR and help us cut down flakes. |
@smarterclayton: All pull requests linked via external trackers have merged. Bugzilla bug 1779331 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@soltysh: new pull request created: #200 In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
A bunch of small minor fixes. After these, I was able to debug the init container of the node exporter daemonset host network pod.