containerd

package
v0.6.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultContainerRuntimeEndpoint = "unix:///run/containerd/containerd.sock"
)

Variables

This section is empty.

Functions

func CheckContainerdInstalled

func CheckContainerdInstalled() bool

func CheckContainerdRunning

func CheckContainerdRunning(ctx context.Context) bool

func CheckSocketExists

func CheckSocketExists() bool

func GetVersion

func GetVersion(ctx context.Context, endpoint string) (string, error)

GetVersion gets the version of the containerd runtime.

func GetVersionFromCli

func GetVersionFromCli(ctx context.Context) (string, error)

GetVersionFromCli reads the containerd version from the command "containerd --version". e.g., "containerd containerd.io 1.7.25 bcc810d6b9066471b0b6fa75f557a15a1cbf31bb"

func IsErrUnimplemented

func IsErrUnimplemented(err error) bool

IsErrUnimplemented checks if the error is due to the unimplemented service. e.g., rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService

Types

type PodSandbox

type PodSandbox struct {
	ID         string                      `json:"id,omitempty"`
	Namespace  string                      `json:"namespace,omitempty"`
	Name       string                      `json:"name,omitempty"`
	State      string                      `json:"state,omitempty"`
	Containers []PodSandboxContainerStatus `json:"containers,omitempty"`
}

PodSandbox represents the pod information fetched from the local container runtime. Simplified version of k8s.io/cri-api/pkg/apis/runtime/v1.PodSandbox. ref. https://pkg.go.dev/k8s.io/cri-api/pkg/apis/runtime/v1#ListPodSandboxResponse

func ListAllSandboxes

func ListAllSandboxes(ctx context.Context, endpoint string) ([]PodSandbox, error)

ListAllSandboxes lists all sandboxes from the containerd runtime.

type PodSandboxContainerStatus

type PodSandboxContainerStatus struct {
	ID        string `json:"id,omitempty"`
	Name      string `json:"name,omitempty"`
	Image     string `json:"image,omitempty"`
	CreatedAt int64  `json:"created_at,omitempty"`
	State     string `json:"state,omitempty"`
}

ref. https://pkg.go.dev/k8s.io/cri-api/pkg/apis/runtime/v1#ContainerStatus

Jump to

Keyboard shortcuts

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