crio

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CRIO_CONFIG_DIR           = "/etc/crictl.yaml"
	DEFAULT_RUNTIME_ENDPOINTS = []string{"unix:///var/run/crio/crio.sock"}
	DEFAULT_IMAGE_ENDPOINTS   = []string{"unix:///var/run/crio/crio.sock"}
	DEFAULT_TIMEOUT           = "5s"

	// RuntimeEndpoint is CRI server runtime endpoint
	RuntimeEndpoint string
	// RuntimeEndpointIsSet is true when RuntimeEndpoint is configured
	RuntimeEndpointIsSet bool
	// ImageEndpoint is CRI server image endpoint, default same as runtime endpoint
	ImageEndpoint string
	// ImageEndpointIsSet is true when ImageEndpoint is configured
	ImageEndpointIsSet bool
	// Timeout  of connecting to server (default: 10s)
	Timeout time.Duration
	// Debug enable debug output
	Debug bool
	// PullImageOnCreate enables pulling image on create requests
	PullImageOnCreate bool
	// DisablePullOnRun disable pulling image on run requests
	DisablePullOnRun bool
)

Functions

func GetAddressAndDialer

func GetAddressAndDialer(endpoint string) (string, func(ctx context.Context, addr string) (net.Conn, error), error)

code clone from https://github.com/kubernetes/kubernetes/blob/v1.22.2/pkg/kubelet/util/util_unix.go#L82 due to broken package dependency // Start

func GetContainerIDFromContainerName

func GetContainerIDFromContainerName(containerName string, cfg *CrioConfig) string

// kubelet code cloned

func GetContainerPid

func GetContainerPid(containerID string, cfg *CrioConfig) int

func Get_CRICTL_CONFIG

func Get_CRICTL_CONFIG()

func Initialize

func Initialize(cfg *CrioConfig) error

func ListContainers

func ListContainers(runtimeClient runtimeapi.RuntimeServiceClient, imageClient runtimeapi.ImageServiceClient, opts listOptions) error

func NetDial

func NetDial()

func RuntimeServiceTestfunc

func RuntimeServiceTestfunc(cfg *CrioConfig) error

Types

type Container

type Container struct {
	Info Information `json:"info"`
}

type CrioConfig

type CrioConfig struct {
	// RuntimeEndpoint is CRI server runtime endpoint
	RuntimeEndpoint string
	// RuntimeEndpointIsSet is true when RuntimeEndpoint is configured
	RuntimeEndpointIsSet bool
	// ImageEndpoint is CRI server image endpoint, default same as runtime endpoint
	ImageEndpoint string
	// ImageEndpointIsSet is true when ImageEndpoint is configured
	ImageEndpointIsSet bool
	// Timeout  of connecting to server (default: 10s)
	Timeout time.Duration
	// Debug enable debug output
	Debug bool
	// PullImageOnCreate enables pulling image on create requests
	PullImageOnCreate bool
	// DisablePullOnRun disable pulling image on run requests
	DisablePullOnRun bool
}

type Information

type Information struct {
	Pid int `json:"pid"`
}

type Inspect

type Inspect struct {
	Contain Container
}

Jump to

Keyboard shortcuts

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