Documentation ¶
Overview ¶
Package criutil contains utility functions for interacting with the Container Runtime Interface (CRI), principally via the crictl command line tool. This requires critools to be installed on the local system.
Index ¶
- func ResolvePath(executable string) string
- type Crictl
- func (cc *Crictl) CleanUp()
- func (cc *Crictl) Create(podID, contSpecFile, sbSpecFile string) (string, error)
- func (cc *Crictl) Exec(contID string, args ...string) (string, error)
- func (cc *Crictl) Import(image string) error
- func (cc *Crictl) Logs(contID string, args ...string) (string, error)
- func (cc *Crictl) PodIP(podID string) (string, error)
- func (cc *Crictl) Rm(contID string) error
- func (cc *Crictl) RmPod(podID string) error
- func (cc *Crictl) RunPod(runtime, sbSpecFile string) (string, error)
- func (cc *Crictl) Start(contID string) (string, error)
- func (cc *Crictl) StartContainer(podID, image, sbSpec, contSpec string) (string, error)
- func (cc *Crictl) StartPodAndContainer(runtime, image, sbSpec, contSpec string) (string, string, error)
- func (cc *Crictl) Stop(contID string) error
- func (cc *Crictl) StopContainer(contID string) error
- func (cc *Crictl) StopPod(podID string) error
- func (cc *Crictl) StopPodAndContainer(podID, contID string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolvePath ¶
ResolvePath attempts to find binary paths. It may set the path to invalid, which will cause the execution to fail with a sensible error.
Types ¶
type Crictl ¶
type Crictl struct {
// contains filtered or unexported fields
}
Crictl contains information required to run the crictl utility.
func NewCrictl ¶
NewCrictl returns a Crictl configured with a timeout and an endpoint over which it will talk to containerd.
func (*Crictl) Create ¶
Create creates a container within a sandbox. It corresponds to `crictl create`.
func (*Crictl) StartContainer ¶
StartContainer pulls the given image ands starts the container in the sandbox with the given podID.
Note that the image will always be imported from the local docker daemon.
func (*Crictl) StartPodAndContainer ¶
func (cc *Crictl) StartPodAndContainer(runtime, image, sbSpec, contSpec string) (string, string, error)
StartPodAndContainer starts a sandbox and container in that sandbox. It returns the pod ID and container ID.
func (*Crictl) StopContainer ¶
StopContainer stops and deletes the container with the given container ID.
func (*Crictl) StopPodAndContainer ¶
StopPodAndContainer stops a container and pod.