depot

package
v0.0.0-...-8deac7e Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 9 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDoesNotExist = errors.New("does not exist")

Functions

This section is empty.

Types

type BindMountSourceCreator

type BindMountSourceCreator interface {
	Create(containerDir string, privileged bool) ([]garden.BindMount, error)
}

type BundleLoader

type BundleLoader interface {
	Load(path string) (goci.Bndl, error)
}

type BundleLookupper

type BundleLookupper interface {
	Lookup(log lager.Logger, handle string) (string, error)
	Handles() ([]string, error)
}

type BundleSaver

type BundleSaver interface {
	Save(bundle goci.Bndl, path string) error
}

type Chowner

type Chowner interface {
	Chown(path string, uid, gid int) error
}

type DepotBindMountSourceCreator

type DepotBindMountSourceCreator struct {
	BindMountPoints      []string
	Chowner              Chowner
	ContainerRootHostUID int
	ContainerRootHostGID int
}

func (DepotBindMountSourceCreator) Create

func (b DepotBindMountSourceCreator) Create(containerDir string, chown bool) ([]garden.BindMount, error)

Create will create and chown a file in the container's depot to be bind-mounted into the container. The name of this file will be the basename of the mount destination. A consequence of this is that we currently can't create mountpoints with the same basename, e.g. /var/foo and /etc/foo. This restriction doesn't affect user-provided bind mounts.

type DirectoryDepot

type DirectoryDepot struct {
	// contains filtered or unexported fields
}

a depot which stores containers as subdirs of a depot directory

func New

func New(dir string, bundleSaver BundleSaver, bundleLoader BundleLoader) *DirectoryDepot

func (*DirectoryDepot) Create

func (d *DirectoryDepot) Create(log lager.Logger, handle string, bundle goci.Bndl) (string, error)

func (*DirectoryDepot) CreatedTime

func (d *DirectoryDepot) CreatedTime(log lager.Logger, handle string) (time.Time, error)

func (*DirectoryDepot) Destroy

func (d *DirectoryDepot) Destroy(log lager.Logger, handle string) error

func (*DirectoryDepot) GetDir

func (d *DirectoryDepot) GetDir() string

func (*DirectoryDepot) Handles

func (d *DirectoryDepot) Handles() ([]string, error)

func (*DirectoryDepot) Load

func (d *DirectoryDepot) Load(log lager.Logger, handle string) (goci.Bndl, error)

func (*DirectoryDepot) Lookup

func (d *DirectoryDepot) Lookup(log lager.Logger, handle string) (string, error)

type NetworkDepot

type NetworkDepot struct {
	// contains filtered or unexported fields
}

func NewNetworkDepot

func NewNetworkDepot(
	dir string,
	bindMountSourceCreator BindMountSourceCreator,
) NetworkDepot

func (NetworkDepot) Destroy

func (d NetworkDepot) Destroy(log lager.Logger, handle string) error

func (NetworkDepot) SetupBindMounts

func (d NetworkDepot) SetupBindMounts(log lager.Logger, handle string, privileged bool, rootfsPath string) ([]garden.BindMount, error)

type OSChowner

type OSChowner struct{}

func (*OSChowner) Chown

func (*OSChowner) Chown(path string, uid, gid int) error

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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