util

package
v0.0.0-...-cf1ce7d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2024 License: CC0-1.0 Imports: 15 Imported by: 0

Documentation

Overview

SPDX-License-Identifier: CC0-1.0 https://creativecommons.org/publicdomain/zero/1.0/

SPDX-License-Identifier: CC0-1.0 https://creativecommons.org/publicdomain/zero/1.0/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClientset

func GetClientset() (*kubernetes.Clientset, error)

func GetNetns

func GetNetns(ctx context.Context, pod, ns string) (string, error)

GetNetns Returns the Linux netns path for a K8s namespace/pod

func GetPOD

func GetPOD(ctx context.Context, ns, pod string) (*k8s.Pod, error)

func GetPodSandbox

func GetPodSandbox(
	ctx context.Context, conn *RuntimeConnection, pod, ns string) (
	*cri.PodSandbox, error)

GetPodSandbox Returns the runtime PodSandbox for a K8s namespace/pod

Types

type RuntimeConnection

type RuntimeConnection struct {
	io.Closer
	// contains filtered or unexported fields
}

func NewRuntimeConnection

func NewRuntimeConnection(
	ctx context.Context, uri string) (*RuntimeConnection, error)

NewRuntimeConnection Create a connection to the runtime The socket is searched in order from;

  • The passed uri
  • $CONTAINER_RUNTIME_ENDPOINT
  • unix:///run/crio/crio.sock
  • unix:///run/containerd/containerd.sock
  • unix:///var/run/crio/crio.sock

func (*RuntimeConnection) Close

func (conn *RuntimeConnection) Close() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL