Move libkpod/image libkpod/layer to libpod/images and libpod/layers
Begin moving image and layer handling out of libkpod into libpod. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
47ef2f66df
commit
e18e962238
26 changed files with 272 additions and 104 deletions
|
@ -2,6 +2,7 @@ package libpod
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"sync"
|
||||
|
||||
"github.com/containers/image/types"
|
||||
|
@ -28,6 +29,7 @@ type Runtime struct {
|
|||
seccompEnabled bool
|
||||
valid bool
|
||||
lock sync.RWMutex
|
||||
output io.Writer
|
||||
}
|
||||
|
||||
// RuntimeConfig contains configuration options used to set up the runtime
|
||||
|
@ -212,60 +214,3 @@ func (r *Runtime) LookupPod(idOrName string) (*pod.Pod, error) {
|
|||
func (r *Runtime) GetPods(filters ...PodFilter) ([]*pod.Pod, error) {
|
||||
return nil, ctr.ErrNotImplemented
|
||||
}
|
||||
|
||||
// Image API
|
||||
|
||||
// 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 ImageFilter func(*storage.Image) bool
|
||||
|
||||
// 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 (r *Runtime) PullImage(image string, allTags bool) (*storage.Image, error) {
|
||||
return nil, ctr.ErrNotImplemented
|
||||
}
|
||||
|
||||
// PushImage pushes the given image to a location described by the given path
|
||||
func (r *Runtime) PushImage(image *storage.Image, destination string) error {
|
||||
return ctr.ErrNotImplemented
|
||||
}
|
||||
|
||||
// TagImage adds a tag to the given image
|
||||
func (r *Runtime) TagImage(image *storage.Image, tag string) error {
|
||||
return ctr.ErrNotImplemented
|
||||
}
|
||||
|
||||
// UntagImage removes a tag from the given image
|
||||
func (r *Runtime) UntagImage(image *storage.Image, tag string) error {
|
||||
return ctr.ErrNotImplemented
|
||||
}
|
||||
|
||||
// RemoveImage deletes an image from local storage
|
||||
// Images being used by running containers cannot be removed
|
||||
func (r *Runtime) RemoveImage(image *storage.Image) error {
|
||||
return ctr.ErrNotImplemented
|
||||
}
|
||||
|
||||
// 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 (r *Runtime) GetImage(image string) (*storage.Image, error) {
|
||||
return nil, ctr.ErrNotImplemented
|
||||
}
|
||||
|
||||
// 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 (r *Runtime) GetImages(filter ...ImageFilter) ([]*storage.Image, error) {
|
||||
return nil, ctr.ErrNotImplemented
|
||||
}
|
||||
|
||||
// ImportImage imports an OCI format image archive into storage as an image
|
||||
func (r *Runtime) ImportImage(path string) (*storage.Image, error) {
|
||||
return nil, ctr.ErrNotImplemented
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue