Documentation ¶
Index ¶
- Constants
- Variables
- func BuildArchiveURL(op trace.Operation, disklabel, target string, fs *archive.FilterSpec, ...) (string, error)
- func GetToolboxClient(op trace.Operation, vm *vm.VirtualMachine, id string) (*toolbox.Client, error)
- func IsToolBoxStateChangeErr(err error) bool
- func VolumeJoin(op trace.Operation, handle *exec.Handle, volume *storage.Volume, ...) (*exec.Handle, error)
- type ContainerStore
- func (c *ContainerStore) Export(op trace.Operation, id, ancestor string, spec *archive.FilterSpec, data bool) (io.ReadCloser, error)
- func (c *ContainerStore) Import(op trace.Operation, id string, spec *archive.FilterSpec, ...) error
- func (c *ContainerStore) NewDataSink(op trace.Operation, id string) (storage.DataSink, error)
- func (c *ContainerStore) NewDataSource(op trace.Operation, id string) (storage.DataSource, error)
- func (c *ContainerStore) Owners(op trace.Operation, url *url.URL, filter func(vm *mo.VirtualMachine) bool) ([]*vm.VirtualMachine, error)
- func (c *ContainerStore) URL(op trace.Operation, id string) (*url.URL, error)
- type ContainerStorer
- type ImageStore
- func (v *ImageStore) CreateImageStore(op trace.Operation, storeName string) (*url.URL, error)
- func (v *ImageStore) DeleteImage(op trace.Operation, image *portlayer.Image) (*portlayer.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) (*portlayer.Image, 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) ([]*portlayer.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 *portlayer.Image, ID string, meta map[string][]byte, ...) (*portlayer.Image, error)
- type ToolboxDataSink
- type ToolboxDataSource
- func (t *ToolboxDataSource) Close() error
- func (t *ToolboxDataSource) Export(op trace.Operation, spec *archive.FilterSpec, data bool) (io.ReadCloser, error)
- func (t *ToolboxDataSource) Source() interface{}
- func (t *ToolboxDataSource) Stat(op trace.Operation, spec *archive.FilterSpec) (*storage.FileStat, error)
- type VolumeStore
- func (v *VolumeStore) Export(op trace.Operation, id, ancestor string, spec *archive.FilterSpec, data bool) (io.ReadCloser, error)
- func (v *VolumeStore) Import(op trace.Operation, id string, spec *archive.FilterSpec, ...) error
- func (v *VolumeStore) NewDataSink(op trace.Operation, id string) (storage.DataSink, error)
- func (v *VolumeStore) NewDataSource(op trace.Operation, id string) (storage.DataSource, error)
- func (v *VolumeStore) URL(op trace.Operation, id string) (*url.URL, error)
- func (v *VolumeStore) VolumeCreate(op trace.Operation, ID string, store *url.URL, capacityKB uint64, ...) (*storage.Volume, error)
- func (v *VolumeStore) VolumeDestroy(op trace.Operation, vol *storage.Volume) error
- func (v *VolumeStore) VolumeGet(op trace.Operation, ID string) (*storage.Volume, error)
- func (v *VolumeStore) VolumesList(op trace.Operation) ([]*storage.Volume, error)
Constants ¶
const (
StorageImageDir = "images"
)
const (
VixEToolsNotRunning = "(3016, 0)"
)
Variables ¶
var ( 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, } )
Set to false for unit tests
Functions ¶
func BuildArchiveURL ¶
func BuildArchiveURL(op trace.Operation, disklabel, target string, fs *archive.FilterSpec, recurse, data bool) (string, error)
Parse Archive builds an archive url with disklabel, filtersec, recursive, and data booleans.
func GetToolboxClient ¶
func GetToolboxClient(op trace.Operation, vm *vm.VirtualMachine, id string) (*toolbox.Client, error)
GetToolboxClient returns a toolbox client given a vm and id
func IsToolBoxStateChangeErr ¶
IsToolBoxConflictErr checks for conflictError for online import
Types ¶
type ContainerStore ¶
ContainerStore stores container storage information
func NewContainerStore ¶
func NewContainerStore(op trace.Operation, s *session.Session, imageResolver storage.Resolver) (*ContainerStore, error)
NewContainerStore creates and returns a new container store
func (*ContainerStore) Export ¶
func (c *ContainerStore) Export(op trace.Operation, id, ancestor string, spec *archive.FilterSpec, data bool) (io.ReadCloser, error)
func (*ContainerStore) Import ¶
func (c *ContainerStore) Import(op trace.Operation, id string, spec *archive.FilterSpec, tarstream io.ReadCloser) error
func (*ContainerStore) NewDataSink ¶
NewDataSink creates and returns an DataSink associated with container storage
func (*ContainerStore) NewDataSource ¶
func (c *ContainerStore) NewDataSource(op trace.Operation, id string) (storage.DataSource, error)
NewDataSource creates and returns an DataSource associated with container storage
func (*ContainerStore) Owners ¶
func (c *ContainerStore) 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 resource specified by `url`
type ContainerStorer ¶
ContainerStorer defines the interface contract expected to allow import and export against containers
type ImageStore ¶
func NewImageStore ¶
func (*ImageStore) CreateImageStore ¶
func (*ImageStore) DeleteImage ¶
func (v *ImageStore) DeleteImage(op trace.Operation, image *portlayer.Image) (*portlayer.Image, error)
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) 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 *portlayer.Image, ID string, meta map[string][]byte, sum string, r io.Reader) (*portlayer.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
type ToolboxDataSink ¶
type ToolboxDataSink struct { ID string VM *vm.VirtualMachine Clean func() }
ToolboxDataSink implements the DataSink interface for mounted devices
func (*ToolboxDataSink) Close ¶
func (t *ToolboxDataSink) Close() error
func (*ToolboxDataSink) Import ¶
func (t *ToolboxDataSink) Import(op trace.Operation, spec *archive.FilterSpec, data io.ReadCloser) error
Import writes `data` to the data sink associated with this DataSink
func (*ToolboxDataSink) Sink ¶
func (t *ToolboxDataSink) Sink() interface{}
Sink returns the data sink associated with the DataSink
type ToolboxDataSource ¶
type ToolboxDataSource struct { ID string VM *vm.VirtualMachine Clean func() }
ToolboxDataSource implements the DataSource interface for mounted devices
func (*ToolboxDataSource) Close ¶
func (t *ToolboxDataSource) Close() error
func (*ToolboxDataSource) Export ¶
func (t *ToolboxDataSource) Export(op trace.Operation, spec *archive.FilterSpec, data bool) (io.ReadCloser, error)
Export reads data from the associated data source and returns it as a tar archive
func (*ToolboxDataSource) Source ¶
func (t *ToolboxDataSource) Source() interface{}
Source returns the data source associated with the DataSource
func (*ToolboxDataSource) Stat ¶
func (t *ToolboxDataSource) Stat(op trace.Operation, spec *archive.FilterSpec) (*storage.FileStat, error)
Stat returns file stats of the destination header determined but the filterspec inclusion path
type VolumeStore ¶
VolumeStore caches Volume references to volumes in the system.
func NewVolumeStore ¶
func (*VolumeStore) Export ¶
func (v *VolumeStore) Export(op trace.Operation, id, ancestor string, spec *archive.FilterSpec, data bool) (io.ReadCloser, error)
Export reads the delta between child and parent volume layers, returning the difference as a tar archive.
store - the volume store containing the two layers id - must inherit from ancestor if ancestor is specified ancestor - the volume layer up the chain against which to diff spec - describes filters on paths found in the data (include, exclude, strip) data - set to true to include file data in the tar archive, false to include headers only
func (*VolumeStore) Import ¶
func (v *VolumeStore) Import(op trace.Operation, id string, spec *archive.FilterSpec, tarstream io.ReadCloser) error
func (*VolumeStore) NewDataSink ¶
NewDataSource creates and returns an DataSource associated with container storage
func (*VolumeStore) NewDataSource ¶
func (v *VolumeStore) NewDataSource(op trace.Operation, id string) (storage.DataSource, error)
NewDataSource creates and returns an DataSource associated with container storage