vsphere

package
v1.5.2-dev Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2019 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StorageImageDir = "images"
)

Variables

View Source
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

func Join

func Join(op trace.Operation, handle *exec.Handle, id, imgID, repoName string, img *image.Image) (*exec.Handle, error)

Types

type ImageStore

type ImageStore struct {
	disk.Vmdk
}

func NewImageStore

func NewImageStore(op trace.Operation, s *session.Session, u *url.URL) (*ImageStore, error)

func (*ImageStore) CreateImageStore

func (v *ImageStore) CreateImageStore(op trace.Operation, storeName string) (*url.URL, error)

func (*ImageStore) DeleteImage

func (v *ImageStore) DeleteImage(op trace.Operation, image *image.Image) (*image.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) GetImage

func (v *ImageStore) GetImage(op trace.Operation, store *url.URL, ID string) (*image.Image, error)

func (*ImageStore) GetImageLayerStorageUsage

func (v *ImageStore) GetImageLayerStorageUsage(op trace.Operation, storeName, ID string) (int64, error)

func (*ImageStore) GetImageStorageUsage

func (v *ImageStore) GetImageStorageUsage(op trace.Operation, storeName string) (int64, error)

func (*ImageStore) GetImageStore

func (v *ImageStore) GetImageStore(op trace.Operation, storeName string) (*url.URL, error)

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 (v *ImageStore) ListImageStores(op trace.Operation) ([]*url.URL, error)

func (*ImageStore) ListImages

func (v *ImageStore) ListImages(op trace.Operation, store *url.URL, IDs []string) ([]*image.Image, error)

func (*ImageStore) NewDataSink

func (i *ImageStore) NewDataSink(op trace.Operation, id string) (storage.DataSink, error)

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

func (v *ImageStore) URL(op trace.Operation, id string) (*url.URL, error)

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL