func DetectCRISocket() (string, error)
DetectCRISocket uses a list of known CRI sockets to detect one. If more than one or none is discovered, an error is returned.
CRIRuntime is a struct that interfaces with the CRI
type CRIRuntime struct {
// contains filtered or unexported fields
}
func (runtime *CRIRuntime) ImageExists(image string) (bool, error)
ImageExists checks to see if the image exists on the system
func (runtime *CRIRuntime) IsRunning() error
IsRunning checks if runtime is running
func (runtime *CRIRuntime) ListKubeContainers() ([]string, error)
ListKubeContainers lists running k8s CRI pods
func (runtime *CRIRuntime) PullImage(image string) error
PullImage pulls the image
func (runtime *CRIRuntime) PullImagesInParallel(images []string, ifNotPresent bool) error
PullImagesInParallel pulls a list of images in parallel
func (runtime *CRIRuntime) RemoveContainers(containers []string) error
RemoveContainers removes running k8s pods
func (runtime *CRIRuntime) SandboxImage() (string, error)
SandboxImage returns the sandbox image used by the container runtime
func (runtime *CRIRuntime) Socket() string
Socket returns the CRI socket endpoint
ContainerRuntime is an interface for working with container runtimes
type ContainerRuntime interface { Socket() string IsRunning() error ListKubeContainers() ([]string, error) RemoveContainers(containers []string) error PullImage(image string) error PullImagesInParallel(images []string, ifNotPresent bool) error ImageExists(image string) (bool, error) SandboxImage() (string, error) }
func NewContainerRuntime(execer utilsexec.Interface, criSocket string) (ContainerRuntime, error)
NewContainerRuntime sets up and returns a ContainerRuntime struct