-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
List all k8s debuggable containers #84
base: master
Are you sure you want to change the base?
List all k8s debuggable containers #84
Conversation
Signed-off-by: Evan Harris <[email protected]>
Signed-off-by: Evan Harris <[email protected]>
@@ -96,6 +96,23 @@ func HandleKubernetesRuntime( | |||
return | |||
} | |||
|
|||
if commandParams.ActionListDebuggableContainers { |
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.
@eharris128 what was the reason to move commandParams.ActionListDebuggableContainers here? Was the intent to support listing debuggable containers across all pods in the (selected) 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.
Yes exactly. Although what you point out below was neglected with this approach.
} | ||
|
||
for cname, iname := range result { | ||
xc.Out.Info("debuggable.container", ovars{"name": cname, "image": iname}) |
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.
@eharris128 if the intent is to show all debuggable containers across all pods then we need the pod name for each record we are printing here.
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.
Agreed. Definitely a necessary extension.
@@ -136,22 +153,6 @@ func HandleKubernetesRuntime( | |||
"ec.count": len(pod.Spec.EphemeralContainers), | |||
}).Debug("target pod info") | |||
|
|||
if commandParams.ActionListDebuggableContainers { |
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.
@eharris128 it might still be good to have an option to list all debuggable containers in a given pod, but if we have both options (to list them for all pods and for a specific pod) then we'll need a separate flag for this, so you can explicitly select what option you want.
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.
Yeah supporting both paths - per pod and across pods seems reasonable to me.
I do not remember how the --list-debuggable-containers
flag performs right now (or before my change) if one passed in --pod
as well.
Feels like adding a new flag to differentiate by one pod versus all pods would be the clearest UX.
What
make fmt
against syscall filesWhy
How Tested
Screencast.from.2024-11-07.15-20-10.webm