Documentation ¶
Index ¶
- Constants
- Variables
- func MatchesID(id, argID string) bool
- func MatchesReference(name, argName string) bool
- func ParseImageNames(names []string) (tags, digests []string, err error)
- type Container
- func (c *Container) Attach(stdin, tty bool) (string, error)
- func (c *Container) Commit() (*storage.Image, error)
- func (c *Container) Create() error
- func (c *Container) Exec(cmd []string, tty bool, stdin bool) (string, error)
- func (c *Container) Export(path string) error
- func (c *Container) ID() string
- func (c *Container) Kill(signal uint) error
- func (c *Container) Mount() (string, error)
- func (c *Container) Name() string
- func (c *Container) Spec() *spec.Spec
- func (c *Container) Start() error
- func (c *Container) Status() error
- func (c *Container) Stop() error
- type ContainerFilter
- type CopyData
- func (c *CopyData) Annotations() map[string]string
- func (c *CopyData) Architecture() string
- func (c *CopyData) MakeImageRef(manifestType string, compress archive.Compression, names []string, ...) (types.ImageReference, error)
- func (c *CopyData) OS() string
- func (c *CopyData) Save() error
- func (c *CopyData) SetArchitecture(arch string)
- func (c *CopyData) SetOS(os string)
- func (c *CopyData) SetWorkDir(there string)
- func (c *CopyData) WorkDir() string
- type CopyOptions
- type CopyRef
- func (c *CopyRef) DeleteImage(*types.SystemContext) error
- func (c *CopyRef) DockerReference() reference.Named
- func (c *CopyRef) NewImage(sc *types.SystemContext) (types.Image, error)
- func (c *CopyRef) NewImageDestination(sc *types.SystemContext) (types.ImageDestination, error)
- func (c *CopyRef) NewImageSource(sc *types.SystemContext) (src types.ImageSource, err error)
- func (c *CopyRef) PolicyConfigurationIdentity() string
- func (c *CopyRef) PolicyConfigurationNamespaces() []string
- func (c *CopyRef) StringWithinTransport() string
- func (c *CopyRef) Transport() types.ImageTransport
- type CtrCreateOption
- func WithAnnotations(annotations map[string]string) CtrCreateOption
- func WithLabels(labels map[string]string) CtrCreateOption
- func WithName(name string) CtrCreateOption
- func WithRootFSFromImage(image string, useImageConfig bool) CtrCreateOption
- func WithRootFSFromPath(path string) CtrCreateOption
- func WithSharedNamespaces(from *Container, namespaces map[string]string) CtrCreateOption
- func WithStopSignal(signal uint) CtrCreateOption
- type Data
- type ImageFilter
- type ImageFilterParams
- type Pod
- type PodCreateOption
- type PodFilter
- type Runtime
- func (r *Runtime) GetConfig() *RuntimeConfig
- func (r *Runtime) GetContainer(id string) (*Container, error)
- func (r *Runtime) GetContainerCopyData(name string) (*CopyData, error)
- func (r *Runtime) GetContainers(filters ...ContainerFilter) ([]*Container, error)
- func (r *Runtime) GetData(name string) (*Data, error)
- func (r *Runtime) GetDiff(from, to string) ([]archive.Change, error)
- func (r *Runtime) GetHistory(image string) ([]ociv1.History, []types.BlobInfo, string, error)
- func (r *Runtime) GetImage(image string) (*storage.Image, error)
- func (r *Runtime) GetImageCopyData(image string) (*CopyData, error)
- func (r *Runtime) GetImageInspectInfo(image storage.Image) (*types.ImageInspectInfo, error)
- func (r *Runtime) GetImageRef(image string) (types.Image, error)
- func (r *Runtime) GetImages(params *ImageFilterParams, filters ...ImageFilter) ([]*storage.Image, error)
- func (r *Runtime) GetPod(id string) (*Pod, error)
- func (r *Runtime) HasContainer(id string) (bool, error)
- func (r *Runtime) HasPod(id string) (bool, error)
- func (r *Runtime) ImportCopyDataFromImage(systemContext *types.SystemContext, imageID, containerName, containerID string) (*CopyData, error)
- func (r *Runtime) ImportImage(path string) (*storage.Image, error)
- func (r *Runtime) InfoAndDigestAndSize(img storage.Image) (*types.ImageInspectInfo, digest.Digest, int64, error)
- func (r *Runtime) LookupContainer(idOrName string) (*Container, error)
- func (r *Runtime) LookupPod(idOrName string) (*Pod, error)
- func (r *Runtime) NewContainer(spec *spec.Spec, options ...CtrCreateOption) (*Container, error)
- func (r *Runtime) NewPod(options ...PodCreateOption) (*Pod, error)
- func (r *Runtime) ParseImageFilter(imageInput, filter string) (*ImageFilterParams, error)
- func (r *Runtime) Pods(filters ...PodFilter) ([]*Pod, error)
- func (r *Runtime) PullImage(imgName string, allTags bool, signaturePolicyPath string, ...) error
- func (r *Runtime) PushImage(source string, destination string, options CopyOptions, reportWriter io.Writer) error
- func (r *Runtime) RemoveContainer(c *Container, force bool) error
- func (r *Runtime) RemoveImage(image *storage.Image, force bool) (string, error)
- func (r *Runtime) RemovePod(p *Pod, force bool) error
- func (r *Runtime) Shutdown(force bool) error
- func (r *Runtime) TagImage(image *storage.Image, tag string) error
- func (r *Runtime) UntagImage(image *storage.Image, tag string) (string, error)
- func (r *Runtime) WithPod(pod *Pod) CtrCreateOption
- type RuntimeConfig
- type RuntimeOption
- func WithCgroupManager(manager string) RuntimeOption
- func WithConmonEnv(environment []string) RuntimeOption
- func WithConmonPath(path string) RuntimeOption
- func WithImageConfig(defaultTransport string, insecureRegistries, registries []string) RuntimeOption
- func WithOCIRuntime(runtimePath string) RuntimeOption
- func WithPidsLimit(limit int64) RuntimeOption
- func WithSELinux() RuntimeOption
- func WithSignaturePolicy(path string) RuntimeOption
- func WithStorageConfig(config storage.StoreOptions) RuntimeOption
- type State
Constants ¶
const ( // Package is used to identify working containers Package = "kpod" // OCIv1ImageManifest is the MIME type of an OCIv1 image manifest, // suitable for specifying as a value of the PreferredManifestType // member of a CommitOptions structure. It is also the default. OCIv1ImageManifest = v1.MediaTypeImageManifest )
const ( // IPCNamespace represents the IPC namespace IPCNamespace = "ipc" // MountNamespace represents the mount namespace MountNamespace = "mount" // NetNamespace represents the network namespace NetNamespace = "net" // PIDNamespace represents the PID namespace PIDNamespace = "pid" // UserNamespace represents the user namespace UserNamespace = "user" // UTSNamespace represents the UTS namespace UTSNamespace = "uts" )
const ( // DefaultRegistry is a prefix that we apply to an image name // to check docker hub first for the image DefaultRegistry = "docker://" )
Variables ¶
var ( // ErrNoSuchCtr indicates the requested container does not exist ErrNoSuchCtr = errors.New("no such container") // ErrNoSuchPod indicates the requested pod does not exist ErrNoSuchPod = errors.New("no such pod") // ErrNoSuchImage indicates the requested image does not exist ErrNoSuchImage = errors.New("no such image") // ErrCtrExists indicates a container with the same name or ID already // exists ErrCtrExists = errors.New("container already exists") // ErrPodExists indicates a pod with the same name or ID already exists ErrPodExists = errors.New("pod already exists") // ErrImageExists indicated an image with the same ID already exists ErrImageExists = errors.New("image already exists") // ErrRuntimeFinalized indicates that the runtime has already been // created and cannot be modified ErrRuntimeFinalized = errors.New("runtime has been finalized") // ErrCtrFinalized indicates that the container has already been created // and cannot be modified ErrCtrFinalized = errors.New("container has been finalized") // ErrPodFinalized indicates that the pod has already been created and // cannot be modified ErrPodFinalized = errors.New("pod has been finalized") // ErrInvalidArg indicates that an invalid argument was passed ErrInvalidArg = errors.New("invalid argument") // ErrRuntimeStopped indicates that the runtime has already been shut // down and no further operations can be performed on it ErrRuntimeStopped = errors.New("runtime has already been stopped") // ErrCtrStopped indicates that the requested container is not running // and the requested operation cannot be performed until it is started ErrCtrStopped = errors.New("container is stopped") // ErrCtrRemoved indicates that the container has already been removed // and no further operations can be performed on it ErrCtrRemoved = errors.New("container has already been removed") // ErrPodRemoved indicates that the pod has already been removed and no // further operations can be performed on it ErrPodRemoved = errors.New("pod has already been removed") // ErrNotImplemented indicates that the requested functionality is not // yet present ErrNotImplemented = errors.New("not yet implemented") )
var ( // DockerArchive is the transport we prepend to an image name // when saving to docker-archive DockerArchive = dockerarchive.Transport.Name() // OCIArchive is the transport we prepend to an image name // when saving to oci-archive OCIArchive = ociarchive.Transport.Name() )
Functions ¶
func MatchesReference ¶
MatchesReference returns true if argName is a full or partial match for name Partial matches will register only if they match the most specific part of the name available For example, take the image docker.io/library/redis:latest redis, library/redis, docker.io/library/redis, redis:latest, etc. will match But redis:alpine, ry/redis, library, and io/library/redis will not
func ParseImageNames ¶
ParseImageNames parses the names we've stored with an image into a list of tagged references and a list of references which contain digests.
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container is a single OCI container
func (*Container) Attach ¶
Attach attaches to a container Returns fully qualified URL of streaming server for the container
func (*Container) Commit ¶
Commit commits the changes between a container and its image, creating a new image If the container was not created from an image (for example, WithRootFSFromPath will create a container from a directory on the system), a new base image will be created from the contents of the container's filesystem
func (*Container) Exec ¶
Exec starts a new process inside the container Returns fully qualified URL of streaming server for executed process
func (*Container) Export ¶
Export exports a container's root filesystem as a tar archive The archive will be saved as a file at the given path
func (*Container) Mount ¶
Mount mounts a container's filesystem on the host The path where the container has been mounted is returned
type ContainerFilter ¶
ContainerFilter is a function to determine whether a container is included in command output. Containers to be outputted are tested using the function. A true return will include the container, a false return will exclude it.
type CopyData ¶
type CopyData struct { // Type is used to help identify a build container's metadata. It // should not be modified. Type string `json:"type"` // FromImage is the name of the source image which was used to create // the container, if one was used. It should not be modified. FromImage string `json:"image,omitempty"` // FromImageID is the ID of the source image which was used to create // the container, if one was used. It should not be modified. FromImageID string `json:"image-id"` // Config is the source image's configuration. It should not be // modified. Config []byte `json:"config,omitempty"` // Manifest is the source image's manifest. It should not be modified. Manifest []byte `json:"manifest,omitempty"` // Container is the name of the build container. It should not be modified. Container string `json:"container-name,omitempty"` // ContainerID is the ID of the build container. It should not be modified. ContainerID string `json:"container-id,omitempty"` // MountPoint is the last location where the container's root // filesystem was mounted. It should not be modified. MountPoint string `json:"mountpoint,omitempty"` // ImageAnnotations is a set of key-value pairs which is stored in the // image's manifest. ImageAnnotations map[string]string `json:"annotations,omitempty"` // ImageCreatedBy is a description of how this container was built. ImageCreatedBy string `json:"created-by,omitempty"` // Image metadata and runtime settings, in multiple formats. OCIv1 v1.Image `json:"ociv1,omitempty"` Docker docker.V2Image `json:"docker,omitempty"` // contains filtered or unexported fields }
CopyData stores the basic data used when copying a container or image
func (*CopyData) Annotations ¶
Annotations gets the anotations of the container or image
func (*CopyData) Architecture ¶
Architecture returns a name of the architecture on which a container built using this image is intended to be run.
func (*CopyData) MakeImageRef ¶
func (c *CopyData) MakeImageRef(manifestType string, compress archive.Compression, names []string, layerID string, historyTimestamp *time.Time) (types.ImageReference, error)
MakeImageRef converts a CopyData struct into a types.ImageReference
func (*CopyData) OS ¶
OS returns a name of the OS on which a container built using this image is intended to be run.
func (*CopyData) SetArchitecture ¶
SetArchitecture sets the name of the architecture on which ta container built using this image is intended to be run.
func (*CopyData) SetOS ¶
SetOS sets the name of the OS on which a container built using this image is intended to be run.
func (*CopyData) SetWorkDir ¶
SetWorkDir sets the location of the default working directory for running commands in a container built using this image.
type CopyOptions ¶
type CopyOptions struct { // Compression specifies the type of compression which is applied to // layer blobs. The default is to not use compression, but // archive.Gzip is recommended. Compression archive.Compression // DockerRegistryOptions encapsulates settings that affect how we // connect or authenticate to a remote registry to which we want to // push the image. common.DockerRegistryOptions // SigningOptions encapsulates settings that control whether or not we // strip or add signatures to the image when pushing (uploading) the // image to a registry. common.SigningOptions // SigningPolicyPath this points to a alternative signature policy file, used mainly for testing SignaturePolicyPath string }
CopyOptions contains the options given when pushing or pulling images
type CopyRef ¶
type CopyRef struct {
// contains filtered or unexported fields
}
CopyRef handles image references used for copying images to/from remotes
func (*CopyRef) DeleteImage ¶
func (c *CopyRef) DeleteImage(*types.SystemContext) error
DeleteImage deletes an image in the CopyRef
func (*CopyRef) DockerReference ¶
DockerReference gets the docker reference for the given CopyRef
func (*CopyRef) NewImageDestination ¶
func (c *CopyRef) NewImageDestination(sc *types.SystemContext) (types.ImageDestination, error)
NewImageDestination creates a new image destination from the given system context
func (*CopyRef) NewImageSource ¶
func (c *CopyRef) NewImageSource(sc *types.SystemContext) (src types.ImageSource, err error)
NewImageSource creates a new image source from the given system context and manifest
func (*CopyRef) PolicyConfigurationIdentity ¶
PolicyConfigurationIdentity returns the policy configuration for the CopyRef
func (*CopyRef) PolicyConfigurationNamespaces ¶
PolicyConfigurationNamespaces returns the policy configuration namespace for the CopyRef
func (*CopyRef) StringWithinTransport ¶
StringWithinTransport returns the first name of the copyRef
func (*CopyRef) Transport ¶
func (c *CopyRef) Transport() types.ImageTransport
Transport returns an ImageTransport for the given CopyRef
type CtrCreateOption ¶
A CtrCreateOption is a functional option which alters the Container created by NewContainer
func WithAnnotations ¶
func WithAnnotations(annotations map[string]string) CtrCreateOption
WithAnnotations adds annotations to the pod
func WithLabels ¶
func WithLabels(labels map[string]string) CtrCreateOption
WithLabels adds labels to the pod
func WithRootFSFromImage ¶
func WithRootFSFromImage(image string, useImageConfig bool) CtrCreateOption
WithRootFSFromImage sets up a fresh root filesystem using the given image If useImageConfig is specified, image volumes, environment variables, and other configuration from the image will be added to the config
func WithRootFSFromPath ¶
func WithRootFSFromPath(path string) CtrCreateOption
WithRootFSFromPath uses the given path as a container's root filesystem No further setup is performed on this path
func WithSharedNamespaces ¶
func WithSharedNamespaces(from *Container, namespaces map[string]string) CtrCreateOption
WithSharedNamespaces sets a container to share namespaces with another container. If the from container belongs to a pod, the new container will be added to the pod. By default no namespaces are shared. To share a namespace, add the Namespace string constant to the map as a key
func WithStopSignal ¶
func WithStopSignal(signal uint) CtrCreateOption
WithStopSignal sets the signal that will be sent to stop the container
type Data ¶
type Data struct { ID string Tags []string Digests []string ManifestDigest digest.Digest Comment string Created *time.Time Container string Author string Config ociv1.ImageConfig Architecture string OS string Annotations map[string]string CreatedBy string Size uint VirtualSize uint GraphDriver driver.Data RootFS ociv1.RootFS }
Data handles the data used when inspecting a container nolint
type ImageFilter ¶
type ImageFilter func(*storage.Image, *types.ImageInspectInfo) bool
ImageFilter is a function to determine whether an image is included in command output. Images to be outputted are tested using the function. A true return will include the image, a false return will exclude it.
type ImageFilterParams ¶
type ImageFilterParams struct { Dangling string Label string BeforeImage time.Time SinceImage time.Time ReferencePattern string ImageName string ImageInput string }
ImageFilterParams contains the filter options that may be given when outputting images
type Pod ¶
type Pod struct {
// contains filtered or unexported fields
}
Pod represents a group of containers that may share namespaces
func (*Pod) GetContainers ¶
GetContainers retrieves the containers in the pod
type PodCreateOption ¶
A PodCreateOption is a functional option which alters the Pod created by NewPod
func WithPodName ¶
func WithPodName(name string) PodCreateOption
WithPodName sets the name of the pod
type PodFilter ¶
PodFilter is a function to determine whether a pod is included in command output. Pods to be outputted are tested using the function. A true return will include the pod, a false return will exclude it.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime is the core libpod runtime
func NewRuntime ¶
func NewRuntime(options ...RuntimeOption) (*Runtime, error)
NewRuntime creates a new container runtime Options can be passed to override the default configuration for the runtime
func (*Runtime) GetConfig ¶
func (r *Runtime) GetConfig() *RuntimeConfig
GetConfig returns a copy of the configuration used by the runtime
func (*Runtime) GetContainer ¶
GetContainer retrieves a container by its ID
func (*Runtime) GetContainerCopyData ¶
GetContainerCopyData gets the copy data for a container
func (*Runtime) GetContainers ¶
func (r *Runtime) GetContainers(filters ...ContainerFilter) ([]*Container, error)
GetContainers retrieves all containers from the state Filters can be provided which will determine what containers are included in the output. Multiple filters are handled by ANDing their output, so only containers matching all filters are returned
func (*Runtime) GetData ¶
GetData gets the Data for a container with the given name in the given store.
func (*Runtime) GetDiff ¶
GetDiff returns the differences between the two images, layers, or containers
func (*Runtime) GetHistory ¶
GetHistory gets the history of an image and information about its layers
func (*Runtime) GetImage ¶
GetImage retrieves an image matching the given name or hash from system storage If no matching image can be found, an error is returned
func (*Runtime) GetImageCopyData ¶
GetImageCopyData gets the copy data for an image
func (*Runtime) GetImageInspectInfo ¶
GetImageInspectInfo returns the inspect information of an image
func (*Runtime) GetImageRef ¶
GetImageRef searches for and returns a new types.Image matching the given name or ID in the given store.
func (*Runtime) GetImages ¶
func (r *Runtime) GetImages(params *ImageFilterParams, filters ...ImageFilter) ([]*storage.Image, error)
GetImages retrieves all images present in storage Filters can be provided which will determine which images are included in the output. Multiple filters are handled by ANDing their output, so only images matching all filters are included
func (*Runtime) HasContainer ¶
HasContainer checks if a container with the given ID is present
func (*Runtime) ImportCopyDataFromImage ¶
func (r *Runtime) ImportCopyDataFromImage(systemContext *types.SystemContext, imageID, containerName, containerID string) (*CopyData, error)
ImportCopyDataFromImage creates copy data for an image with the given parameters
func (*Runtime) ImportImage ¶
ImportImage imports an OCI format image archive into storage as an image
func (*Runtime) InfoAndDigestAndSize ¶
func (r *Runtime) InfoAndDigestAndSize(img storage.Image) (*types.ImageInspectInfo, digest.Digest, int64, error)
InfoAndDigestAndSize returns the inspection info and size of the image in the given store and the digest of its manifest, if it has one, or "" if it doesn't.
func (*Runtime) LookupContainer ¶
LookupContainer looks up a container by its name or a partial ID If a partial ID is not unique, an error will be returned
func (*Runtime) LookupPod ¶
LookupPod retrieves a pod by its name or a partial ID If a partial ID is not unique, an error will be returned
func (*Runtime) NewContainer ¶
NewContainer creates a new container from a given OCI config
func (*Runtime) NewPod ¶
func (r *Runtime) NewPod(options ...PodCreateOption) (*Pod, error)
NewPod makes a new, empty pod
func (*Runtime) ParseImageFilter ¶
func (r *Runtime) ParseImageFilter(imageInput, filter string) (*ImageFilterParams, error)
ParseImageFilter takes a set of images and a filter string as input, and returns the libpod.ImageFilterParams struct
func (*Runtime) Pods ¶
Pods retrieves all pods Filters can be provided which will determine which pods are included in the output. Multiple filters are handled by ANDing their output, so only pods matching all filters are returned
func (*Runtime) PullImage ¶
func (r *Runtime) PullImage(imgName string, allTags bool, signaturePolicyPath string, reportWriter io.Writer) error
PullImage pulls an image from configured registries By default, only the latest tag (or a specific tag if requested) will be pulled. If allTags is true, all tags for the requested image will be pulled. Signature validation will be performed if the Runtime has been appropriately configured
func (*Runtime) PushImage ¶
func (r *Runtime) PushImage(source string, destination string, options CopyOptions, reportWriter io.Writer) error
PushImage pushes the given image to a location described by the given path
func (*Runtime) RemoveContainer ¶
RemoveContainer removes the given container If force is specified, the container will be stopped first Otherwise, RemoveContainer will return an error if the container is running
func (*Runtime) RemoveImage ¶
RemoveImage deletes an image from local storage Images being used by running containers can only be removed if force=true
func (*Runtime) RemovePod ¶
RemovePod removes a pod and all containers in it If force is specified, all containers in the pod will be stopped first Otherwise, RemovePod will return an error if any container in the pod is running Remove acts atomically, removing all containers or no containers
func (*Runtime) Shutdown ¶
Shutdown shuts down the runtime and associated containers and storage If force is true, containers and mounted storage will be shut down before cleaning up; if force is false, an error will be returned if there are still containers running or mounted
func (*Runtime) UntagImage ¶
UntagImage removes a tag from the given image
func (*Runtime) WithPod ¶
func (r *Runtime) WithPod(pod *Pod) CtrCreateOption
WithPod adds the container to a pod
type RuntimeConfig ¶
type RuntimeConfig struct { StorageConfig storage.StoreOptions ImageDefaultTransport string InsecureRegistries []string Registries []string SignaturePolicyPath string RuntimePath string ConmonPath string ConmonEnvVars []string CgroupManager string SelinuxEnabled bool PidsLimit int64 }
RuntimeConfig contains configuration options used to set up the runtime
type RuntimeOption ¶
A RuntimeOption is a functional option which alters the Runtime created by NewRuntime
func WithCgroupManager ¶
func WithCgroupManager(manager string) RuntimeOption
WithCgroupManager specifies the manager implementation name which is used to handle cgroups for containers
func WithConmonEnv ¶
func WithConmonEnv(environment []string) RuntimeOption
WithConmonEnv specifies the environment variable list for the conmon process
func WithConmonPath ¶
func WithConmonPath(path string) RuntimeOption
WithConmonPath specifies the path to the conmon binary which manages the runtime
func WithImageConfig ¶
func WithImageConfig(defaultTransport string, insecureRegistries, registries []string) RuntimeOption
WithImageConfig uses the given configuration to set up image handling If this is not specified, the system default configuration will be used instead
func WithOCIRuntime ¶
func WithOCIRuntime(runtimePath string) RuntimeOption
WithOCIRuntime specifies an OCI runtime to use for running containers
func WithPidsLimit ¶
func WithPidsLimit(limit int64) RuntimeOption
WithPidsLimit specifies the maximum number of processes each container is restricted to
func WithSELinux ¶
func WithSELinux() RuntimeOption
WithSELinux enables SELinux on the container server
func WithSignaturePolicy ¶
func WithSignaturePolicy(path string) RuntimeOption
WithSignaturePolicy specifies the path of a file which decides how trust is managed for images we've pulled. If this is not specified, the system default configuration will be used instead
func WithStorageConfig ¶
func WithStorageConfig(config storage.StoreOptions) RuntimeOption
WithStorageConfig uses the given configuration to set up container storage If this is not specified, the system default configuration will be used instead
type State ¶
type State interface { // Accepts full ID of container GetContainer(id string) (*Container, error) // Accepts full or partial IDs (as long as they are unique) and names LookupContainer(idOrName string) (*Container, error) // Checks if a container with the given ID is present in the state HasContainer(id string) (bool, error) // Adds container to state // If the container belongs to a pod, that pod must already be present // in the state when the container is added AddContainer(ctr *Container) error // Removes container from state // If the container belongs to a pod, it will be removed from the pod // as well RemoveContainer(ctr *Container) error // Retrieves all containers presently in state GetAllContainers() ([]*Container, error) // Accepts full ID of pod GetPod(id string) (*Pod, error) // Accepts full or partial IDs (as long as they are unique) and names LookupPod(idOrName string) (*Pod, error) // Checks if a pod with the given ID is present in the state HasPod(id string) (bool, error) // Adds pod to state // Any containers within the pod not already in the state will be added // with it AddPod(pod *Pod) error // Removes pod from state // All containers within the pod will also be removed RemovePod(pod *Pod) error // Retrieves all pods presently in state GetAllPods() ([]*Pod, error) }
State is a storage backend for libpod's current state