daemon

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: Apache-2.0 Imports: 51 Imported by: 15

Documentation

Index

Constants

View Source
const (
	E_NOT_FOUND       = -2
	E_UNDER_OPERATION = -1
	E_OK              = 0
)

Variables

View Source
var (
	DefaultLogPrefix string = "/var/run/hyper/Pods"
)
View Source
var StorageDrivers map[string]func(*dockertypes.Info, *daemondb.DaemonDB) (Storage, error) = map[string]func(*dockertypes.Info, *daemondb.DaemonDB) (Storage, error){
	"devicemapper": DMFactory,
	"aufs":         AufsFactory,
	"overlay":      OverlayFsFactory,
	"btrfs":        BtrfsFactory,
	"rawblock":     RawBlockFactory,
	"vbox":         VBoxStorageFactory,
}

Functions

func InitDockerCfg added in v0.6.0

func InitDockerCfg(mirrors []string, insecureRegistries []string, graphdriver, basesize, root string)

Types

type AufsStorage added in v0.5.0

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

func (*AufsStorage) CleanUp added in v0.5.0

func (*AufsStorage) CleanUp() error

func (*AufsStorage) CleanupContainer added in v0.6.0

func (a *AufsStorage) CleanupContainer(id, sharedDir string) error

func (*AufsStorage) CreateVolume added in v0.5.0

func (a *AufsStorage) CreateVolume(podId string, spec *apitypes.UserVolume) error

func (*AufsStorage) Init added in v0.5.0

func (*AufsStorage) InjectFile added in v0.5.0

func (a *AufsStorage) InjectFile(src io.Reader, containerId, target, baseDir string, perm, uid, gid int) error

func (*AufsStorage) PrepareContainer added in v0.5.0

func (a *AufsStorage) PrepareContainer(mountId, sharedDir string, readonly bool) (*runv.VolumeDescription, error)

func (*AufsStorage) RemoveVolume added in v0.5.0

func (a *AufsStorage) RemoveVolume(podId string, record []byte) error

func (*AufsStorage) RootPath added in v0.5.0

func (a *AufsStorage) RootPath() string

func (*AufsStorage) Type added in v0.5.0

func (a *AufsStorage) Type() string

type BtrfsStorage added in v0.8.0

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

func (*BtrfsStorage) CleanUp added in v0.8.0

func (*BtrfsStorage) CleanUp() error

func (*BtrfsStorage) CleanupContainer added in v0.8.0

func (s *BtrfsStorage) CleanupContainer(id, sharedDir string) error

func (*BtrfsStorage) CreateVolume added in v0.8.0

func (s *BtrfsStorage) CreateVolume(podId string, spec *apitypes.UserVolume) error

func (*BtrfsStorage) Init added in v0.8.0

func (*BtrfsStorage) InjectFile added in v0.8.0

func (s *BtrfsStorage) InjectFile(src io.Reader, mountId, target, baseDir string, perm, uid, gid int) error

func (*BtrfsStorage) PrepareContainer added in v0.8.0

func (s *BtrfsStorage) PrepareContainer(containerId, sharedDir string, readonly bool) (*runv.VolumeDescription, error)

func (*BtrfsStorage) RemoveVolume added in v0.8.0

func (s *BtrfsStorage) RemoveVolume(podId string, record []byte) error

func (*BtrfsStorage) RootPath added in v0.8.0

func (s *BtrfsStorage) RootPath() string

func (*BtrfsStorage) Type added in v0.8.0

func (s *BtrfsStorage) Type() string

type ContainerLogsConfig added in v0.6.0

type ContainerLogsConfig struct {
	// if true stream log output
	Follow bool
	// if true include timestamps for each line of log output
	Timestamps bool
	// return that many lines of log output from the end
	Tail string
	// filter logs by returning on those entries after this time
	Since time.Time
	// whether or not to show stdout and stderr as well as log entries.
	UseStdout, UseStderr bool
	OutStream            io.Writer
	Stop                 <-chan bool
}

ContainerLogsConfig holds configs for logging operations. Exists for users of the daemon to to pass it a logging configuration.

type Daemon

type Daemon struct {
	*docker.Daemon
	ID string

	PodList    *pod.PodList
	Factory    factory.Factory
	Host       string
	Storage    Storage
	Hypervisor string
	DefaultLog *pod.GlobalLogConfig
	// contains filtered or unexported fields
}

func NewDaemon

func NewDaemon(cfg *apitypes.HyperConfig) (*Daemon, error)

func (*Daemon) AddService added in v0.5.0

func (daemon *Daemon) AddService(podId string, srvs []*apitypes.UserService) error

func (*Daemon) Attach added in v0.6.0

func (daemon *Daemon) Attach(stdin io.ReadCloser, stdout io.WriteCloser, container string) error

func (*Daemon) CmdAddPortMappings added in v1.0.0

func (daemon *Daemon) CmdAddPortMappings(podId string, req []byte) (*engine.Env, error)

func (*Daemon) CmdAddService added in v0.6.0

func (daemon *Daemon) CmdAddService(podId, data string) (*engine.Env, error)

func (*Daemon) CmdAttach

func (daemon *Daemon) CmdAttach(stdin io.ReadCloser, stdout io.WriteCloser, container string) error

func (*Daemon) CmdAuthenticateToRegistry added in v0.6.0

func (daemon *Daemon) CmdAuthenticateToRegistry(config *types.AuthConfig) (string, error)

func (*Daemon) CmdCleanPod added in v0.6.0

func (daemon *Daemon) CmdCleanPod(podId string) (*engine.Env, error)

func (*Daemon) CmdCommitImage added in v0.6.0

func (daemon *Daemon) CmdCommitImage(name string, cfg *types.ContainerCommitConfig) (*engine.Env, error)

func (*Daemon) CmdContainerRename added in v0.6.0

func (daemon *Daemon) CmdContainerRename(oldname, newname string) (*engine.Env, error)

func (*Daemon) CmdCreateContainer added in v0.6.0

func (daemon *Daemon) CmdCreateContainer(podId string, containerArgs []byte) (string, error)

func (*Daemon) CmdCreatePod added in v0.6.0

func (daemon *Daemon) CmdCreatePod(podArgs string) (*engine.Env, error)

FIXME: there was a `config` argument passed by docker/builder, but we never processed it.

func (*Daemon) CmdDeletePortMappings added in v1.0.0

func (daemon *Daemon) CmdDeletePortMappings(podId string, req []byte) (*engine.Env, error)

func (*Daemon) CmdDeleteService added in v0.6.0

func (daemon *Daemon) CmdDeleteService(podId, data string) (*engine.Env, error)

func (*Daemon) CmdExitCode added in v0.5.0

func (daemon *Daemon) CmdExitCode(containerId, execId string) (int, error)

func (*Daemon) CmdGetContainerInfo added in v0.6.0

func (daemon *Daemon) CmdGetContainerInfo(name string) (interface{}, error)

func (*Daemon) CmdGetContainerLogs added in v0.6.0

func (daemon *Daemon) CmdGetContainerLogs(container string, config *ContainerLogsConfig) (err error)

func (*Daemon) CmdGetPodInfo added in v0.6.0

func (daemon *Daemon) CmdGetPodInfo(podName string) (interface{}, error)

func (*Daemon) CmdGetPodStats added in v0.6.0

func (daemon *Daemon) CmdGetPodStats(podId string) (interface{}, error)

func (*Daemon) CmdGetServices added in v0.6.0

func (daemon *Daemon) CmdGetServices(podId string) ([]*apitypes.UserService, error)

func (*Daemon) CmdImageDelete added in v0.6.0

func (daemon *Daemon) CmdImageDelete(name string, force, prune bool) ([]*apitypes.ImageDelete, error)

func (*Daemon) CmdImagePull added in v0.6.2

func (daemon *Daemon) CmdImagePull(image, tag string, authConfig *types.AuthConfig, metaHeaders map[string][]string, output io.Writer) error

func (*Daemon) CmdImagePush added in v0.6.2

func (daemon *Daemon) CmdImagePush(repo, tag string, authConfig *types.AuthConfig, metaHeaders map[string][]string, output io.Writer) error

func (*Daemon) CmdImages added in v0.5.0

func (daemon *Daemon) CmdImages(args, filter string, all bool) (*engine.Env, error)

func (*Daemon) CmdKillContainer added in v0.6.0

func (daemon *Daemon) CmdKillContainer(name string, sig int64) (*engine.Env, error)

func (*Daemon) CmdKillPod added in v0.6.0

func (daemon *Daemon) CmdKillPod(podId, container string, sig int64) (*engine.Env, error)

func (*Daemon) CmdList

func (daemon *Daemon) CmdList(item, podId, vmId string) (*engine.Env, error)

func (*Daemon) CmdListPortMappings added in v1.0.0

func (daemon *Daemon) CmdListPortMappings(podId string) (*engine.Env, error)

pod level port mappings API

func (*Daemon) CmdPausePod added in v0.6.0

func (daemon *Daemon) CmdPausePod(podId string) error

func (*Daemon) CmdRemoveContainer added in v0.8.0

func (daemon *Daemon) CmdRemoveContainer(name string) (*engine.Env, error)

func (*Daemon) CmdSetPodLabels added in v0.6.0

func (daemon *Daemon) CmdSetPodLabels(podId string, override bool, labels map[string]string) (*engine.Env, error)

func (*Daemon) CmdStartContainer added in v0.8.0

func (daemon *Daemon) CmdStartContainer(containerId string) (*engine.Env, error)

func (*Daemon) CmdStartPod added in v0.6.0

func (daemon *Daemon) CmdStartPod(podId string) (*engine.Env, error)

func (*Daemon) CmdStopContainer added in v0.6.2

func (daemon *Daemon) CmdStopContainer(name string) (*engine.Env, error)

func (*Daemon) CmdStopPod added in v0.6.0

func (daemon *Daemon) CmdStopPod(podId, stopVm string) (*engine.Env, error)

func (*Daemon) CmdSystemInfo added in v0.6.0

func (daemon *Daemon) CmdSystemInfo() (*apitypes.InfoResponse, error)

func (*Daemon) CmdSystemVersion added in v0.6.0

func (daemon *Daemon) CmdSystemVersion() *engine.Env

func (*Daemon) CmdTtyResize added in v0.6.0

func (daemon *Daemon) CmdTtyResize(containerId, execId string, h, w int) error

func (*Daemon) CmdUnpausePod added in v0.6.0

func (daemon *Daemon) CmdUnpausePod(podId string) error

func (*Daemon) CmdUpdateService added in v0.6.0

func (daemon *Daemon) CmdUpdateService(podId, data string) (*engine.Env, error)

func (*Daemon) ContainerRename added in v0.6.0

func (daemon *Daemon) ContainerRename(oldname, newname string) error

func (*Daemon) CreateContainerInPod added in v0.6.2

func (daemon *Daemon) CreateContainerInPod(podId string, spec *apitypes.UserContainer) (string, error)

func (*Daemon) CreateExec added in v0.6.2

func (daemon *Daemon) CreateExec(containerId, cmd string, terminal bool) (string, error)

func (*Daemon) CreatePod

func (daemon *Daemon) CreatePod(podId string, podSpec *apitypes.UserPod) (*pod.XPod, error)

func (*Daemon) DeleteService added in v0.5.0

func (daemon *Daemon) DeleteService(podId string, srvs []*apitypes.UserService) error

func (*Daemon) DeleteVolumeId

func (daemon *Daemon) DeleteVolumeId(podId string) error

func (*Daemon) DestroyAllVm

func (daemon *Daemon) DestroyAllVm() error

func (*Daemon) DestroyAndKeepVm

func (daemon *Daemon) DestroyAndKeepVm() error

func (*Daemon) ExecVM added in v0.8.0

func (daemon *Daemon) ExecVM(podID, cmd string, stdin io.ReadCloser, stdout, stderr io.WriteCloser) (int, error)

func (*Daemon) ExitCode added in v0.6.0

func (daemon *Daemon) ExitCode(containerId, execId string) (int, error)

func (*Daemon) ExportImage added in v0.8.0

func (daemon *Daemon) ExportImage(names []string, format string, refs map[string]string, outStream io.Writer) error

ExportImage exports a list of images to the given output stream. The exported images are archived into a tar when written to the output stream. All images with the given tag and all versions containing the same tag are exported. names is the set of tags to export, and outStream is the writer which the images are written to.

func (*Daemon) GetContainerInfo added in v0.6.0

func (daemon *Daemon) GetContainerInfo(name string) (*types.ContainerInfo, error)

func (*Daemon) GetContainerLogs added in v0.6.0

func (daemon *Daemon) GetContainerLogs(container string, config *ContainerLogsConfig) (err error)

func (*Daemon) GetPodByContainerIdOrName added in v0.5.0

func (daemon *Daemon) GetPodByContainerIdOrName(name string) (*pod.XPod, error)

func (*Daemon) GetPodInfo added in v0.6.0

func (daemon *Daemon) GetPodInfo(podName string) (*types.PodInfo, error)

func (*Daemon) GetPodNum

func (daemon *Daemon) GetPodNum() int64

func (*Daemon) GetPodStats added in v0.6.0

func (daemon *Daemon) GetPodStats(podId string) (interface{}, error)

func (*Daemon) GetServices added in v0.5.0

func (daemon *Daemon) GetServices(podId string) ([]*apitypes.UserService, error)

func (*Daemon) GetVmByPodId added in v0.5.0

func (daemon *Daemon) GetVmByPodId(podId string) (string, error)

func (*Daemon) KillContainer added in v0.6.0

func (daemon *Daemon) KillContainer(name string, sig int64) error

func (*Daemon) KillExec added in v0.8.0

func (daemon *Daemon) KillExec(containerId string, execId string, signal int64) error

func (*Daemon) KillPodContainers added in v0.6.0

func (daemon *Daemon) KillPodContainers(podName, container string, sig int64) error

func (*Daemon) List added in v0.6.0

func (daemon *Daemon) List(item, podId, vmId string) (map[string][]string, error)

func (*Daemon) ListContainers added in v0.6.2

func (daemon *Daemon) ListContainers(podId, vmId string) ([]*apitypes.ContainerListResult, error)

func (*Daemon) ListPods added in v0.6.2

func (daemon *Daemon) ListPods(podId, vmId string) ([]*apitypes.PodListResult, error)

func (*Daemon) ListVMs added in v0.6.2

func (daemon *Daemon) ListVMs(podId, vmId string) ([]*apitypes.VMListResult, error)

func (*Daemon) LoadImage added in v0.8.0

func (daemon *Daemon) LoadImage(inTar io.ReadCloser, name string, refs map[string]string, outStream io.Writer) error

LoadImage uploads a set of images into the repository. This is the complement of ImageExport. The input stream is an uncompressed tar ball containing images and metadata.

func (Daemon) PauseContainer added in v0.5.0

func (daemon Daemon) PauseContainer(container string) error

func (Daemon) PausePod added in v0.5.0

func (daemon Daemon) PausePod(podId string) error

func (*Daemon) ReleaseAllVms

func (daemon *Daemon) ReleaseAllVms() error

func (*Daemon) RemoveContainer added in v0.8.0

func (daemon *Daemon) RemoveContainer(nameOrId string) error

func (*Daemon) RemovePod

func (daemon *Daemon) RemovePod(podId string) (int, string, error)

func (*Daemon) Restore

func (daemon *Daemon) Restore() error

func (*Daemon) SetPodLabels added in v0.6.0

func (daemon *Daemon) SetPodLabels(pn string, override bool, labels map[string]string) error

func (*Daemon) Shutdown added in v0.6.0

func (daemon *Daemon) Shutdown() error

func (*Daemon) StartContainer added in v0.8.0

func (daemon *Daemon) StartContainer(containerId string) error

func (*Daemon) StartExec added in v0.6.2

func (daemon *Daemon) StartExec(stdin io.ReadCloser, stdout io.WriteCloser, containerId, execId string) error

func (*Daemon) StartPod

func (daemon *Daemon) StartPod(podId string) error

func (*Daemon) StopContainer added in v0.6.2

func (daemon *Daemon) StopContainer(container string, graceful int) error

func (*Daemon) StopPod

func (daemon *Daemon) StopPod(podId string) (int, string, error)

func (*Daemon) TtyResize added in v0.6.0

func (daemon *Daemon) TtyResize(containerId, execId string, h, w int) error

func (*Daemon) UnpauseContainer added in v0.5.0

func (daemon *Daemon) UnpauseContainer(container string) error

func (*Daemon) UnpausePod added in v0.5.0

func (daemon *Daemon) UnpausePod(podId string) error

func (*Daemon) UpdateService added in v0.5.0

func (daemon *Daemon) UpdateService(podId string, srvs []*apitypes.UserService) error

func (*Daemon) WaitContainer added in v0.8.0

func (daemon *Daemon) WaitContainer(cid string, second int) (int, error)

func (*Daemon) WritePodAndContainers

func (daemon *Daemon) WritePodAndContainers(podId string) error

type DevMapperStorage added in v0.5.0

type DevMapperStorage struct {
	CtnPoolName string
	VolPoolName string
	DevPrefix   string
	FsType      string

	DmPoolData *dm.DeviceMapper
	// contains filtered or unexported fields
}

func (*DevMapperStorage) CleanUp added in v0.5.0

func (dms *DevMapperStorage) CleanUp() error

func (*DevMapperStorage) CleanupContainer added in v0.6.0

func (dms *DevMapperStorage) CleanupContainer(id, sharedDir string) error

func (*DevMapperStorage) CreateVolume added in v0.5.0

func (dms *DevMapperStorage) CreateVolume(podId string, spec *apitypes.UserVolume) error

func (*DevMapperStorage) Init added in v0.5.0

func (*DevMapperStorage) InjectFile added in v0.5.0

func (dms *DevMapperStorage) InjectFile(src io.Reader, mountId, target, baseDir string, perm, uid, gid int) error

func (*DevMapperStorage) PrepareContainer added in v0.5.0

func (dms *DevMapperStorage) PrepareContainer(mountId, sharedDir string, readonly bool) (*runv.VolumeDescription, error)

func (*DevMapperStorage) RemoveVolume added in v0.5.0

func (dms *DevMapperStorage) RemoveVolume(podId string, record []byte) error

func (*DevMapperStorage) RootPath added in v0.5.0

func (dms *DevMapperStorage) RootPath() string

func (*DevMapperStorage) Type added in v0.5.0

func (dms *DevMapperStorage) Type() string

type OverlayFsStorage added in v0.5.0

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

func (*OverlayFsStorage) CleanUp added in v0.5.0

func (*OverlayFsStorage) CleanUp() error

func (*OverlayFsStorage) CleanupContainer added in v0.6.0

func (o *OverlayFsStorage) CleanupContainer(id, sharedDir string) error

func (*OverlayFsStorage) CreateVolume added in v0.5.0

func (o *OverlayFsStorage) CreateVolume(podId string, spec *apitypes.UserVolume) error

func (*OverlayFsStorage) Init added in v0.5.0

func (*OverlayFsStorage) InjectFile added in v0.5.0

func (o *OverlayFsStorage) InjectFile(src io.Reader, mountId, target, baseDir string, perm, uid, gid int) error

func (*OverlayFsStorage) PrepareContainer added in v0.5.0

func (o *OverlayFsStorage) PrepareContainer(mountId, sharedDir string, readonly bool) (*runv.VolumeDescription, error)

func (*OverlayFsStorage) RemoveVolume added in v0.5.0

func (o *OverlayFsStorage) RemoveVolume(podId string, record []byte) error

func (*OverlayFsStorage) RootPath added in v0.5.0

func (o *OverlayFsStorage) RootPath() string

func (*OverlayFsStorage) Type added in v0.5.0

func (o *OverlayFsStorage) Type() string

type RawBlockStorage added in v0.8.0

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

func (*RawBlockStorage) CleanUp added in v0.8.0

func (*RawBlockStorage) CleanUp() error

func (*RawBlockStorage) CleanupContainer added in v0.8.0

func (s *RawBlockStorage) CleanupContainer(id, sharedDir string) error

func (*RawBlockStorage) CreateVolume added in v0.8.0

func (s *RawBlockStorage) CreateVolume(podId string, spec *apitypes.UserVolume) error

func (*RawBlockStorage) Init added in v0.8.0

func (*RawBlockStorage) InjectFile added in v0.8.0

func (s *RawBlockStorage) InjectFile(src io.Reader, mountId, target, baseDir string, perm, uid, gid int) error

func (*RawBlockStorage) PrepareContainer added in v0.8.0

func (s *RawBlockStorage) PrepareContainer(containerId, sharedDir string, readonly bool) (*runv.VolumeDescription, error)

func (*RawBlockStorage) RemoveVolume added in v0.8.0

func (s *RawBlockStorage) RemoveVolume(podId string, record []byte) error

func (*RawBlockStorage) RootPath added in v0.8.0

func (s *RawBlockStorage) RootPath() string

func (*RawBlockStorage) Type added in v0.8.0

func (s *RawBlockStorage) Type() string

type Storage

type Storage interface {
	Type() string
	RootPath() string

	Init(c *apitypes.HyperConfig) error
	CleanUp() error

	PrepareContainer(mountId, sharedDir string, readonly bool) (*runv.VolumeDescription, error)
	CleanupContainer(id, sharedDir string) error
	InjectFile(src io.Reader, containerId, target, baseDir string, perm, uid, gid int) error
	CreateVolume(podId string, spec *apitypes.UserVolume) error
	RemoveVolume(podId string, record []byte) error
}

func AufsFactory added in v0.5.0

func AufsFactory(sysinfo *dockertypes.Info, _ *daemondb.DaemonDB) (Storage, error)

func BtrfsFactory added in v0.8.0

func BtrfsFactory(_ *dockertypes.Info, _ *daemondb.DaemonDB) (Storage, error)

func DMFactory added in v0.5.0

func DMFactory(sysinfo *dockertypes.Info, db *daemondb.DaemonDB) (Storage, error)

func OverlayFsFactory added in v0.5.0

func OverlayFsFactory(_ *dockertypes.Info, _ *daemondb.DaemonDB) (Storage, error)

func RawBlockFactory added in v0.8.0

func RawBlockFactory(_ *dockertypes.Info, _ *daemondb.DaemonDB) (Storage, error)

func StorageFactory added in v0.5.0

func StorageFactory(sysinfo *dockertypes.Info, db *daemondb.DaemonDB) (Storage, error)

func VBoxStorageFactory added in v0.5.0

func VBoxStorageFactory(_ *dockertypes.Info, _ *daemondb.DaemonDB) (Storage, error)

type VBoxStorage added in v0.5.0

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

func (*VBoxStorage) CleanUp added in v0.5.0

func (*VBoxStorage) CleanUp() error

func (*VBoxStorage) CleanupContainer added in v0.6.0

func (v *VBoxStorage) CleanupContainer(id, sharedDir string) error

func (*VBoxStorage) CreateVolume added in v0.5.0

func (v *VBoxStorage) CreateVolume(podId string, spec *apitypes.UserVolume) error

func (*VBoxStorage) Init added in v0.5.0

func (*VBoxStorage) InjectFile added in v0.5.0

func (v *VBoxStorage) InjectFile(src io.Reader, containerId, target, rootDir string, perm, uid, gid int) error

func (*VBoxStorage) PrepareContainer added in v0.5.0

func (v *VBoxStorage) PrepareContainer(mountId, sharedDir string, readonly bool) (*runv.VolumeDescription, error)

func (*VBoxStorage) RemoveVolume added in v0.5.0

func (v *VBoxStorage) RemoveVolume(podId string, record []byte) error

func (*VBoxStorage) RootPath added in v0.5.0

func (v *VBoxStorage) RootPath() string

func (*VBoxStorage) Type added in v0.5.0

func (v *VBoxStorage) Type() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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