Documentation ¶
Index ¶
- Constants
- Variables
- func Join(op trace.Operation, handle *exec.Handle, id, imgID, repoName string, ...) (*exec.Handle, error)
- type ImageStore
- func (v *ImageStore) CreateImageStore(op trace.Operation, storeName string) (*url.URL, error)
- func (v *ImageStore) DeleteImage(op trace.Operation, image *image.Image) (*image.Image, error)
- func (v *ImageStore) DeleteImageStore(op trace.Operation, storeName string) error
- func (i *ImageStore) Export(op trace.Operation, id, ancestor string, spec *archive.FilterSpec, data bool) (io.ReadCloser, error)
- func (v *ImageStore) GetImage(op trace.Operation, store *url.URL, ID string) (*image.Image, error)
- func (v *ImageStore) GetImageLayerStorageUsage(op trace.Operation, storeName, ID string) (int64, error)
- func (v *ImageStore) GetImageStorageUsage(op trace.Operation, storeName string) (int64, error)
- func (v *ImageStore) GetImageStore(op trace.Operation, storeName string) (*url.URL, error)
- func (i *ImageStore) Import(op trace.Operation, id string, spec *archive.FilterSpec, ...) error
- func (v *ImageStore) ListImageStores(op trace.Operation) ([]*url.URL, error)
- func (v *ImageStore) ListImages(op trace.Operation, store *url.URL, IDs []string) ([]*image.Image, error)
- func (i *ImageStore) NewDataSink(op trace.Operation, id string) (storage.DataSink, error)
- func (i *ImageStore) NewDataSource(op trace.Operation, id string) (storage.DataSource, error)
- func (v *ImageStore) Owners(op trace.Operation, url *url.URL, filter func(vm *mo.VirtualMachine) bool) ([]*vm.VirtualMachine, error)
- func (v *ImageStore) URL(op trace.Operation, id string) (*url.URL, error)
- func (v *ImageStore) WriteImage(op trace.Operation, parent *image.Image, ID string, meta map[string][]byte, ...) (*image.Image, error)
Constants ¶
const (
StorageImageDir = "images"
)
Variables ¶
var ( // Set to false for unit tests DetachAll = true FileForMinOS = map[string]os.FileMode{ "/etc/hostname": 0644, "/etc/hosts": 0644, "/etc/resolv.conf": 0644, } SymLinkForMinOS = map[string]string{ "/etc/mtab": "/proc/mounts", } // Here the permission of .tether should be drwxrwxrwt. // The sticky bit 't' is added when mounting the tmpfs in bootstrap DirForMinOS = map[string]os.FileMode{ "/etc": 0755, "/lib/modules": 0755, "/proc": 0555, "/sys": 0555, "/run": 0755, "/.tether": 0777, } )
Functions ¶
Types ¶
type ImageStore ¶
func NewImageStore ¶
func (*ImageStore) CreateImageStore ¶
func (*ImageStore) DeleteImage ¶
DeleteImage deletes an image from the image store. If the image is in use either by way of inheritance or because it's attached to a container, this will return an error.
func (*ImageStore) DeleteImageStore ¶
func (v *ImageStore) DeleteImageStore(op trace.Operation, storeName string) error
DeleteImageStore deletes the image store top level directory
func (*ImageStore) Export ¶
func (i *ImageStore) Export(op trace.Operation, id, ancestor string, spec *archive.FilterSpec, data bool) (io.ReadCloser, error)
Export reads the delta between child and parent image layers, returning the difference as a tar archive.
id - must inherit from ancestor if ancestor is specified ancestor - the layer up the chain against which to diff spec - describes filters on paths found in the data (include, exclude, rebase, strip) data - set to true to include file data in the tar archive, false to include headers only
func (*ImageStore) GetImageLayerStorageUsage ¶
func (*ImageStore) GetImageStorageUsage ¶
func (*ImageStore) GetImageStore ¶
GetImageStore checks to see if the image store exists on disk and returns an error or the store's URL.
func (*ImageStore) Import ¶
func (i *ImageStore) Import(op trace.Operation, id string, spec *archive.FilterSpec, tarStream io.ReadCloser) error
func (*ImageStore) ListImageStores ¶
func (*ImageStore) ListImages ¶
func (*ImageStore) NewDataSink ¶
NewDataSink creates and returns an DataSource associated with image storage
func (*ImageStore) NewDataSource ¶
func (i *ImageStore) NewDataSource(op trace.Operation, id string) (storage.DataSource, error)
func (*ImageStore) Owners ¶
func (v *ImageStore) Owners(op trace.Operation, url *url.URL, filter func(vm *mo.VirtualMachine) bool) ([]*vm.VirtualMachine, error)
Owners returns a list of VMs that are using the disk specified by `url`
func (*ImageStore) URL ¶
URL returns a url to the disk image represented by `id` This is a "ds://" URL so cannot be used as input to most of the ImageStore methods that take URLs.
func (*ImageStore) WriteImage ¶
func (v *ImageStore) WriteImage(op trace.Operation, parent *image.Image, ID string, meta map[string][]byte, sum string, r io.Reader) (*image.Image, error)
WriteImage creates a new image layer from the given parent. Eg parentImage + newLayer = new Image built from parent
parent - The parent image to create the new image from. ID - textual ID for the image to be written meta - metadata associated with the image Tag - the tag of the image to be written