Documentation ¶
Index ¶
- Constants
- Variables
- func ProbeExistingVolume(v *pod.UserVolume, sharedDir string) (*hypervisor.VolumeInfo, error)
- func ProcessPodBytes(body []byte, podId string) (*pod.UserPod, error)
- func ServiceDiscoveryContainerName(podName string) string
- type AufsStorage
- func (*AufsStorage) CleanUp() error
- func (a *AufsStorage) CreateVolume(daemon *Daemon, podId, shortName string) (*hypervisor.VolumeInfo, error)
- func (*AufsStorage) Init() error
- func (a *AufsStorage) InjectFile(src io.Reader, containerId, target, rootDir string, perm, uid, gid int) error
- func (a *AufsStorage) PrepareContainer(id, sharedDir string) (*hypervisor.ContainerInfo, error)
- func (a *AufsStorage) RemoveVolume(podId string, record []byte) error
- func (a *AufsStorage) RootPath() string
- func (a *AufsStorage) Type() string
- type Daemon
- func (daemon *Daemon) AddPod(pod *Pod, podArgs string) (err error)
- func (daemon *Daemon) AddService(job *engine.Job) error
- func (daemon *Daemon) AddVm(vm *hypervisor.Vm)
- func (daemon *Daemon) CleanPod(podId string) (int, string, error)
- func (daemon *Daemon) CmdAttach(job *engine.Job) (err error)
- func (daemon *Daemon) CmdAuth(job *engine.Job) error
- func (daemon *Daemon) CmdBuild(job *engine.Job) error
- func (daemon *Daemon) CmdCommit(job *engine.Job) error
- func (daemon *Daemon) CmdContainerInfo(job *engine.Job) error
- func (daemon *Daemon) CmdCreate(job *engine.Job) error
- func (daemon *Daemon) CmdExec(job *engine.Job) (err error)
- func (daemon *Daemon) CmdExitCode(job *engine.Job) (err error)
- func (daemon *Daemon) CmdImages(job *engine.Job) error
- func (daemon *Daemon) CmdImagesRemove(job *engine.Job) error
- func (daemon *Daemon) CmdInfo(job *engine.Job) error
- func (daemon *Daemon) CmdList(job *engine.Job) error
- func (daemon *Daemon) CmdLogs(job *engine.Job) (err error)
- func (daemon *Daemon) CmdPause(job *engine.Job) error
- func (daemon *Daemon) CmdPodCreate(job *engine.Job) error
- func (daemon *Daemon) CmdPodInfo(job *engine.Job) error
- func (daemon *Daemon) CmdPodLabels(job *engine.Job) error
- func (daemon *Daemon) CmdPodRm(job *engine.Job) (err error)
- func (daemon *Daemon) CmdPodStart(job *engine.Job) error
- func (daemon *Daemon) CmdPodStats(job *engine.Job) error
- func (daemon *Daemon) CmdPodStop(job *engine.Job) error
- func (daemon *Daemon) CmdPull(job *engine.Job) error
- func (daemon *Daemon) CmdPush(job *engine.Job) error
- func (daemon *Daemon) CmdRename(job *engine.Job) error
- func (daemon *Daemon) CmdTty(job *engine.Job) (err error)
- func (daemon *Daemon) CmdUnpause(job *engine.Job) error
- func (daemon *Daemon) CmdVersion(job *engine.Job) error
- func (daemon *Daemon) CmdVmCreate(job *engine.Job) (err error)
- func (daemon *Daemon) CmdVmKill(job *engine.Job) error
- func (daemon *Daemon) CreatePod(podId, podArgs string, autoremove bool) error
- func (daemon *Daemon) DbGetVmByPod(podId string) (string, error)
- func (daemon *Daemon) DefaultLogCfg(driver string, cfg map[string]string)
- func (daemon *Daemon) DeletePodContainerFromDB(podName string) error
- func (daemon *Daemon) DeletePodFromDB(podName string) error
- func (daemon *Daemon) DeleteService(job *engine.Job) error
- func (daemon *Daemon) DeleteVmByPod(podId string) error
- func (daemon *Daemon) DeleteVmData(vmId string) error
- func (daemon *Daemon) DeleteVolumeId(podId string) error
- func (daemon *Daemon) DestroyAllVm() error
- func (daemon *Daemon) DestroyAndKeepVm() error
- func (daemon *Daemon) GetExitCode(podId, tag string, callback chan *types.VmResponse) error
- func (daemon *Daemon) GetPod(podId, podArgs string, autoremove bool) (*Pod, error)
- func (daemon *Daemon) GetPodByContainer(containerId string) (string, error)
- func (daemon *Daemon) GetPodByContainerIdOrName(name string) (pod *Pod, idx int, err error)
- func (daemon *Daemon) GetPodByName(podName string) ([]byte, error)
- func (daemon *Daemon) GetPodContainersByName(podName string) ([]string, error)
- func (daemon *Daemon) GetPodNum() int64
- func (daemon *Daemon) GetRunningPodNum() int64
- func (daemon *Daemon) GetServiceContainerInfo(podId string) (*hypervisor.Vm, string, error)
- func (daemon *Daemon) GetServices(job *engine.Job) error
- func (daemon *Daemon) GetVM(vmId string, resource *pod.UserResource, lazy bool, keep int) (*hypervisor.Vm, error)
- func (daemon *Daemon) GetVmByPodId(podId string) (string, error)
- func (daemon *Daemon) GetVmData(vmId string) ([]byte, error)
- func (daemon *Daemon) GetVolumeId(podId, volName string) (int, error)
- func (daemon *Daemon) InitVmCache(cache_policy string) error
- func (daemon *Daemon) Install(eng *engine.Engine) error
- func (daemon *Daemon) KillVm(vmId string) (int, string, error)
- func (daemon *Daemon) NewVm(id string, cpu, memory int, lazy bool, keep int) *hypervisor.Vm
- func (daemon Daemon) PauseContainer(container string) error
- func (daemon Daemon) PausePod(podId string) error
- func (daemon *Daemon) PodStopped(podId string)
- func (daemon *Daemon) ReleaseAllVms() (int, error)
- func (daemon *Daemon) RemovePod(podId string)
- func (daemon *Daemon) RemoveVm(vmId string)
- func (daemon *Daemon) RestartPod(mypod *hypervisor.PodStatus) error
- func (daemon *Daemon) Restore() error
- func (daemon *Daemon) SetVolumeId(podId, volName, dev_id string) error
- func (daemon *Daemon) StartPod(podId, podArgs, vmId string, config interface{}, lazy, autoremove bool, ...) (int, string, error)
- func (daemon *Daemon) StartVm(vmId string, cpu, mem int, lazy, cache bool, keep int) (*hypervisor.Vm, error)
- func (daemon *Daemon) StopPod(podId, stopVm string) (int, string, error)
- func (daemon *Daemon) UnpauseContainer(container string) error
- func (daemon *Daemon) UnpausePod(podId string) error
- func (daemon *Daemon) UpdateService(job *engine.Job) error
- func (daemon *Daemon) UpdateVmByPod(podId, vmId string) error
- func (daemon *Daemon) UpdateVmData(vmId string, data []byte) error
- func (daemon *Daemon) WaitVmStart(vm *hypervisor.Vm) error
- func (daemon *Daemon) WritePodAndContainers(podId string) error
- func (daemon *Daemon) WritePodToDB(podName string, podData []byte) error
- type DevMapperStorage
- func (dms *DevMapperStorage) CleanUp() error
- func (dms *DevMapperStorage) CreateVolume(daemon *Daemon, podId, shortName string) (*hypervisor.VolumeInfo, error)
- func (dms *DevMapperStorage) Init() error
- func (dms *DevMapperStorage) InjectFile(src io.Reader, containerId, target, rootDir string, perm, uid, gid int) error
- func (dms *DevMapperStorage) PrepareContainer(id, sharedDir string) (*hypervisor.ContainerInfo, error)
- func (dms *DevMapperStorage) RemoveVolume(podId string, record []byte) error
- func (dms *DevMapperStorage) RootPath() string
- func (dms *DevMapperStorage) Type() string
- type DockerInterface
- type OverlayFsStorage
- func (*OverlayFsStorage) CleanUp() error
- func (o *OverlayFsStorage) CreateVolume(daemon *Daemon, podId, shortName string) (*hypervisor.VolumeInfo, error)
- func (*OverlayFsStorage) Init() error
- func (o *OverlayFsStorage) InjectFile(src io.Reader, containerId, target, rootDir string, perm, uid, gid int) error
- func (o *OverlayFsStorage) PrepareContainer(id, sharedDir string) (*hypervisor.ContainerInfo, error)
- func (o *OverlayFsStorage) RemoveVolume(podId string, record []byte) error
- func (o *OverlayFsStorage) RootPath() string
- func (o *OverlayFsStorage) Type() string
- type Pod
- func (p *Pod) AssociateVm(daemon *Daemon, vmId string) error
- func (p *Pod) AttachTtys(streams []*hypervisor.TtyIO) (err error)
- func (p *Pod) GetVM(daemon *Daemon, id string, lazy bool, keep int) (err error)
- func (p *Pod) InitContainers(daemon *Daemon, dclient DockerInterface) (err error)
- func (p *Pod) KillVM(daemon *Daemon)
- func (p *Pod) Prepare(daemon *Daemon) (err error)
- func (p *Pod) PrepareContainers(sd Storage, dclient DockerInterface) (err error)
- func (p *Pod) PrepareDNS() (err error)
- func (p *Pod) PrepareEtcHosts() (err error)
- func (p *Pod) PrepareServices() error
- func (p *Pod) PrepareVolume(daemon *Daemon, sd Storage) (err error)
- func (p *Pod) SetVM(id string, vm *hypervisor.Vm)
- func (p *Pod) Start(daemon *Daemon, vmId string, lazy, autoremove bool, keep int, ...) (*types.VmResponse, error)
- func (p *Pod) Status() *hypervisor.PodStatus
- type PodFilterOp
- type PodList
- func (pl *PodList) CountContainers() (num int64)
- func (pl *PodList) CountRunning() int64
- func (pl *PodList) CountStatus(status uint) (num int64)
- func (pl *PodList) Delete(id string)
- func (pl *PodList) Find(fn PodFilterOp) *Pod
- func (pl *PodList) Foreach(fn PodOp) error
- func (pl *PodList) Get(id string) (*Pod, bool)
- func (pl *PodList) GetByName(name string) *Pod
- func (pl *PodList) GetStatus(id string) (*hypervisor.PodStatus, bool)
- func (pl *PodList) Put(p *Pod)
- type PodOp
- type Record
- type Storage
- func AufsFactory(sysinfo *dockertypes.Info) (Storage, error)
- func DMFactory(sysinfo *dockertypes.Info) (Storage, error)
- func OverlayFsFactory(_ *dockertypes.Info) (Storage, error)
- func StorageFactory(sysinfo *dockertypes.Info) (Storage, error)
- func VBoxStorageFactory(_ *dockertypes.Info) (Storage, error)
- type VBoxStorage
- func (*VBoxStorage) CleanUp() error
- func (v *VBoxStorage) CreateVolume(daemon *Daemon, podId, shortName string) (*hypervisor.VolumeInfo, error)
- func (*VBoxStorage) Init() error
- func (v *VBoxStorage) InjectFile(src io.Reader, containerId, target, rootDir string, perm, uid, gid int) error
- func (v *VBoxStorage) PrepareContainer(id, sharedDir string) (*hypervisor.ContainerInfo, error)
- func (v *VBoxStorage) RemoveVolume(podId string, record []byte) error
- func (v *VBoxStorage) RootPath() string
- func (v *VBoxStorage) Type() string
- type VmCache
Constants ¶
Variables ¶
View Source
var (
DefaultResourcePath string = "/var/run/hyper/Pods"
)
View Source
var NewDockerImpl = func() (DockerInterface, error) { return nil, fmt.Errorf("no docker create function") }
View Source
var StorageDrivers map[string]func(*dockertypes.Info) (Storage, error) = map[string]func(*dockertypes.Info) (Storage, error){ "devicemapper": DMFactory, "aufs": AufsFactory, "overlay": OverlayFsFactory, "vbox": VBoxStorageFactory, }
Functions ¶
func ProbeExistingVolume ¶ added in v0.5.0
func ProbeExistingVolume(v *pod.UserVolume, sharedDir string) (*hypervisor.VolumeInfo, error)
func ProcessPodBytes ¶ added in v0.5.0
func ServiceDiscoveryContainerName ¶ added in v0.5.0
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) CreateVolume ¶ added in v0.5.0
func (a *AufsStorage) CreateVolume(daemon *Daemon, podId, shortName string) (*hypervisor.VolumeInfo, error)
func (*AufsStorage) Init ¶ added in v0.5.0
func (*AufsStorage) Init() error
func (*AufsStorage) InjectFile ¶ added in v0.5.0
func (*AufsStorage) PrepareContainer ¶ added in v0.5.0
func (a *AufsStorage) PrepareContainer(id, sharedDir string) (*hypervisor.ContainerInfo, 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 Daemon ¶
type Daemon struct { ID string DockerCli DockerInterface PodList *PodList VmList map[string]*hypervisor.Vm Kernel string Initrd string Bios string Cbfs string VboxImage string BridgeIface string BridgeIP string Host string Storage Storage Hypervisor string DefaultLog *pod.PodLogConfig // contains filtered or unexported fields }
func (*Daemon) AddVm ¶
func (daemon *Daemon) AddVm(vm *hypervisor.Vm)
func (*Daemon) CmdContainerInfo ¶ added in v0.5.0
func (*Daemon) CmdExitCode ¶ added in v0.5.0
func (*Daemon) CmdImagesRemove ¶ added in v0.5.0
func (*Daemon) CmdPodLabels ¶ added in v0.5.0
CmdPodLabels updates labels of the specified pod
func (*Daemon) CmdPodStats ¶ added in v0.5.0
func (*Daemon) CreatePod ¶
FIXME: there was a `config` argument passed by docker/builder, but we never processed it.
func (*Daemon) DbGetVmByPod ¶ added in v0.5.0
func (*Daemon) DefaultLogCfg ¶ added in v0.5.0
func (*Daemon) DeletePodContainerFromDB ¶
func (*Daemon) DeletePodFromDB ¶
func (*Daemon) DeleteService ¶ added in v0.5.0
func (*Daemon) DeleteVmByPod ¶
func (*Daemon) DeleteVmData ¶
func (*Daemon) DeleteVolumeId ¶
func (*Daemon) DestroyAllVm ¶
func (*Daemon) DestroyAndKeepVm ¶
func (*Daemon) GetExitCode ¶ added in v0.5.0
func (daemon *Daemon) GetExitCode(podId, tag string, callback chan *types.VmResponse) error
func (*Daemon) GetPodByContainer ¶
func (*Daemon) GetPodByContainerIdOrName ¶ added in v0.5.0
func (*Daemon) GetPodContainersByName ¶
func (*Daemon) GetRunningPodNum ¶
func (*Daemon) GetServiceContainerInfo ¶ added in v0.5.0
func (*Daemon) GetServices ¶ added in v0.5.0
func (*Daemon) GetVM ¶ added in v0.5.0
func (daemon *Daemon) GetVM(vmId string, resource *pod.UserResource, lazy bool, keep int) (*hypervisor.Vm, error)
func (*Daemon) GetVmByPodId ¶ added in v0.5.0
func (*Daemon) InitVmCache ¶ added in v0.5.0
func (Daemon) PauseContainer ¶ added in v0.5.0
func (*Daemon) PodStopped ¶ added in v0.5.0
func (*Daemon) ReleaseAllVms ¶
func (*Daemon) RestartPod ¶
func (daemon *Daemon) RestartPod(mypod *hypervisor.PodStatus) error
The caller must make sure that the restart policy and the status is right to restart
func (*Daemon) SetVolumeId ¶
func (*Daemon) UnpauseContainer ¶ added in v0.5.0
func (*Daemon) UnpausePod ¶ added in v0.5.0
func (*Daemon) UpdateService ¶ added in v0.5.0
func (*Daemon) UpdateVmByPod ¶
func (*Daemon) WaitVmStart ¶ added in v0.5.0
func (daemon *Daemon) WaitVmStart(vm *hypervisor.Vm) error
func (*Daemon) WritePodAndContainers ¶
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) CreateVolume ¶ added in v0.5.0
func (dms *DevMapperStorage) CreateVolume(daemon *Daemon, podId, shortName string) (*hypervisor.VolumeInfo, error)
func (*DevMapperStorage) Init ¶ added in v0.5.0
func (dms *DevMapperStorage) Init() error
func (*DevMapperStorage) InjectFile ¶ added in v0.5.0
func (*DevMapperStorage) PrepareContainer ¶ added in v0.5.0
func (dms *DevMapperStorage) PrepareContainer(id, sharedDir string) (*hypervisor.ContainerInfo, 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 DockerInterface ¶ added in v0.5.0
type DockerInterface interface { SendCmdCreate(name, image string, entripoint, cmds []string, config interface{}) ([]byte, int, error) SendCmdDelete(arg ...string) ([]byte, int, error) SendCmdInfo(args ...string) (*dockertypes.Info, error) SendCmdImages(all string) ([]*dockertypes.Image, error) GetContainerInfo(args ...string) (*dockertypes.ContainerJSON, error) SendCmdPull(image string, config *graph.ImagePullConfig) ([]byte, int, error) SendCmdAuth(body io.ReadCloser) (string, error) SendCmdPush(remote string, ipconfig *graph.ImagePushConfig) error SendImageDelete(args ...string) ([]dockertypes.ImageDelete, error) SendImageBuild(image string, size int, context io.ReadCloser) ([]byte, int, error) SendContainerCommit(args ...string) ([]byte, int, error) SendContainerRename(oName, nName string) error Shutdown() error Setup() error }
func NewDocker ¶ added in v0.5.0
func NewDocker() (DockerInterface, error)
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) CreateVolume ¶ added in v0.5.0
func (o *OverlayFsStorage) CreateVolume(daemon *Daemon, podId, shortName string) (*hypervisor.VolumeInfo, error)
func (*OverlayFsStorage) Init ¶ added in v0.5.0
func (*OverlayFsStorage) Init() error
func (*OverlayFsStorage) InjectFile ¶ added in v0.5.0
func (*OverlayFsStorage) PrepareContainer ¶ added in v0.5.0
func (o *OverlayFsStorage) PrepareContainer(id, sharedDir string) (*hypervisor.ContainerInfo, 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 Pod ¶
type Pod struct {
// contains filtered or unexported fields
}
I'd like to move the remain part of this file to another file.
func (*Pod) AssociateVm ¶ added in v0.5.0
func (*Pod) AttachTtys ¶ added in v0.5.0
func (p *Pod) AttachTtys(streams []*hypervisor.TtyIO) (err error)
func (*Pod) InitContainers ¶ added in v0.5.0
func (p *Pod) InitContainers(daemon *Daemon, dclient DockerInterface) (err error)
func (*Pod) PrepareContainers ¶ added in v0.5.0
func (p *Pod) PrepareContainers(sd Storage, dclient DockerInterface) (err error)
func (*Pod) PrepareDNS ¶ added in v0.5.0
**
PrepareDNS() Set the resolv.conf of host to each container, except the following cases: - if the pod has a `dns` field with values, the pod will follow the dns setup, and daemon won't insert resolv.conf file into any containers - if the pod has a `file` which source is uri "file:///etc/resolv.conf", this mean the user will handle this file by himself/herself, daemon won't touch the dns setting even if the file is not referenced by any containers. This could be a method to prevent the daemon from unwanted setting the dns configuration - if a container has a file config in the pod spec with `/etc/resolv.conf` as target `path`, then this container won't be set as the file from hosts. Then a user can specify the content of the file.
func (*Pod) PrepareEtcHosts ¶ added in v0.5.0
PrepareEtcHosts sets /etc/hosts for each container
func (*Pod) PrepareServices ¶ added in v0.5.0
func (*Pod) PrepareVolume ¶ added in v0.5.0
func (*Pod) Start ¶ added in v0.5.0
func (p *Pod) Start(daemon *Daemon, vmId string, lazy, autoremove bool, keep int, streams []*hypervisor.TtyIO) (*types.VmResponse, error)
func (*Pod) Status ¶
func (p *Pod) Status() *hypervisor.PodStatus
type PodFilterOp ¶ added in v0.5.0
type PodList ¶ added in v0.5.0
func NewPodList ¶ added in v0.5.0
func NewPodList() *PodList
func (*PodList) CountContainers ¶ added in v0.5.0
func (*PodList) CountRunning ¶ added in v0.5.0
func (*PodList) CountStatus ¶ added in v0.5.0
func (*PodList) Find ¶ added in v0.5.0
func (pl *PodList) Find(fn PodFilterOp) *Pod
type Storage ¶
type Storage interface { Type() string RootPath() string Init() error CleanUp() error PrepareContainer(id, sharedir string) (*hypervisor.ContainerInfo, error) InjectFile(src io.Reader, containerId, target, rootDir string, perm, uid, gid int) error CreateVolume(daemon *Daemon, podId, shortName string) (*hypervisor.VolumeInfo, error) RemoveVolume(podId string, record []byte) error }
func AufsFactory ¶ added in v0.5.0
func AufsFactory(sysinfo *dockertypes.Info) (Storage, error)
func OverlayFsFactory ¶ added in v0.5.0
func OverlayFsFactory(_ *dockertypes.Info) (Storage, error)
func StorageFactory ¶ added in v0.5.0
func StorageFactory(sysinfo *dockertypes.Info) (Storage, error)
func VBoxStorageFactory ¶ added in v0.5.0
func VBoxStorageFactory(_ *dockertypes.Info) (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) CreateVolume ¶ added in v0.5.0
func (v *VBoxStorage) CreateVolume(daemon *Daemon, podId, shortName string) (*hypervisor.VolumeInfo, error)
func (*VBoxStorage) Init ¶ added in v0.5.0
func (*VBoxStorage) Init() error
func (*VBoxStorage) InjectFile ¶ added in v0.5.0
func (*VBoxStorage) PrepareContainer ¶ added in v0.5.0
func (v *VBoxStorage) PrepareContainer(id, sharedDir string) (*hypervisor.ContainerInfo, 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
Click to show internal directories.
Click to hide internal directories.