Documentation ¶
Index ¶
- func DetectCRISocket() (string, error)
- type CRIRuntime
- func (runtime *CRIRuntime) ImageExists(image string) (bool, error)
- func (runtime *CRIRuntime) IsRunning() error
- func (runtime *CRIRuntime) ListKubeContainers() ([]string, error)
- func (runtime *CRIRuntime) PullImage(image string) error
- func (runtime *CRIRuntime) RemoveContainers(containers []string) error
- func (runtime *CRIRuntime) Socket() string
- type ContainerRuntime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectCRISocket ¶ added in v1.14.0
DetectCRISocket uses a list of known CRI sockets to detect one. If more than one or none is discovered, an error is returned.
Types ¶
type CRIRuntime ¶
type CRIRuntime struct {
// contains filtered or unexported fields
}
CRIRuntime is a struct that interfaces with the CRI
func (*CRIRuntime) ImageExists ¶
func (runtime *CRIRuntime) ImageExists(image string) (bool, error)
ImageExists checks to see if the image exists on the system
func (*CRIRuntime) IsRunning ¶
func (runtime *CRIRuntime) IsRunning() error
IsRunning checks if runtime is running
func (*CRIRuntime) ListKubeContainers ¶
func (runtime *CRIRuntime) ListKubeContainers() ([]string, error)
ListKubeContainers lists running k8s CRI pods
func (*CRIRuntime) PullImage ¶
func (runtime *CRIRuntime) PullImage(image string) error
PullImage pulls the image
func (*CRIRuntime) RemoveContainers ¶
func (runtime *CRIRuntime) RemoveContainers(containers []string) error
RemoveContainers removes running k8s pods
func (*CRIRuntime) Socket ¶ added in v1.24.0
func (runtime *CRIRuntime) Socket() string
Socket returns the CRI socket endpoint
type ContainerRuntime ¶
type ContainerRuntime interface { Socket() string IsRunning() error ListKubeContainers() ([]string, error) RemoveContainers(containers []string) error PullImage(image string) error ImageExists(image string) (bool, error) }
ContainerRuntime is an interface for working with container runtimes
func NewContainerRuntime ¶
func NewContainerRuntime(execer utilsexec.Interface, criSocket string) (ContainerRuntime, error)
NewContainerRuntime sets up and returns a ContainerRuntime struct
Click to show internal directories.
Click to hide internal directories.