Skip to content

Support init containers #186

Description

@Stono

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+

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions