Documentation
¶
Index ¶
- Constants
- func CheckContainerdInstalled() bool
- func CheckContainerdRunning(ctx context.Context) bool
- func CheckSocketExists() bool
- func GetVersion(ctx context.Context, endpoint string) (string, error)
- func GetVersionFromCli(ctx context.Context) (string, error)
- func IsErrUnimplemented(err error) bool
- type PodSandbox
- type PodSandboxContainerStatus
Constants ¶
const (
DefaultContainerRuntimeEndpoint = "unix:///run/containerd/containerd.sock"
)
Variables ¶
This section is empty.
Functions ¶
func CheckContainerdInstalled ¶
func CheckContainerdInstalled() bool
func CheckContainerdRunning ¶
func CheckSocketExists ¶
func CheckSocketExists() bool
func GetVersion ¶
GetVersion gets the version of the containerd runtime.
func GetVersionFromCli ¶
GetVersionFromCli reads the containerd version from the command "containerd --version". e.g., "containerd containerd.io 1.7.25 bcc810d6b9066471b0b6fa75f557a15a1cbf31bb"
func IsErrUnimplemented ¶
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