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

Support init containers #186

Open
Stono opened this issue Jul 29, 2024 · 0 comments
Open

Support init containers #186

Stono opened this issue Jul 29, 2024 · 0 comments

Comments

@Stono
Copy link

Stono commented Jul 29, 2024

Hello awesome project.
I've recently moved a bunch of stuff to Kubernetes Native Sidecars and depressingly lost the ability to use ksniff.

Looks like here;

ksniff/pkg/cmd/sniff.go

Lines 332 to 346 in b0b737c

func (o *Ksniff) findContainerId(pod *corev1.Pod) error {
for _, containerStatus := range pod.Status.ContainerStatuses {
if o.settings.UserSpecifiedContainer == containerStatus.Name {
result := strings.Split(containerStatus.ContainerID, "://")
if len(result) != 2 {
break
}
o.settings.DetectedContainerRuntime = result[0]
o.settings.DetectedContainerId = result[1]
return nil
}
}
return errors.Errorf("couldn't find container: '%s' in pod: '%s'", o.settings.UserSpecifiedContainer, o.settings.UserSpecifiedPodName)
}
is only considering ContainerStatuses, whereas native sidecars are under InitContainerStatuses

Would be awesome to support native sidecars.

alpha 1.28+
beta 1.29+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant