operations

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MemoryAlignMB is the value to which container VM memory must align in order for hotadd to work
	MemoryAlignMB = 128
	// MemoryMinMB - the minimum allowable container memory size
	MemoryMinMB = 512
	// MemoryDefaultMB - the default container VM memory size
	MemoryDefaultMB = 2048
	// MinCPUs - the minimum number of allowable CPUs the container can use
	MinCPUs = 1
	// DefaultCPUs - the default number of container VM CPUs
	DefaultCPUs   = 2
	DefaultMemory = 512
	MiBytesUnit   = 1024 * 1024

	// Errors
	PodCreatorPortlayerClientError = VicPodCreatorError("PodCreator called with an invalid portlayer client")
	PodCreatorImageStoreError      = VicPodCreatorError("PodCreator called with an invalid image store")
	PodCreatorIsolationProxyError  = VicPodCreatorError("PodCreator called with an invalid isolation proxy")
	PodCreatorPodCacheError        = VicPodCreatorError("PodCreator called with an invalid pod cache")
	PodCreatorPersonaAddrError     = VicPodCreatorError("PodCreator called with an invalid VIC persona addr")
	PodCreatorPortlayerAddrError   = VicPodCreatorError("PodCreator called with an invalid VIC portlayer addr")
	PodCreatorInvalidPodSpecError  = VicPodCreatorError("CreatePod called with nil pod")
	PodCreatorInvalidArgsError     = VicPodCreatorError("Invalid arguments")
)
View Source
const (
	PodDeleterPortlayerClientError = VicPodDeleterError("PodDeleter called with an invalid portlayer client")
	PodDeleterIsolationProxyError  = VicPodDeleterError("PodDeleter called with an invalid isolation proxy")
	PodDeleterPodCacheError        = VicPodDeleterError("PodDeleter called with an invalid pod cache")
	PodDeleterPersonaAddrError     = VicPodDeleterError("PodDeleter called with an invalid VIC persona addr")
	PodDeleterPortlayerAddrError   = VicPodDeleterError("PodDeleter called with an invalid VIC portlayer addr")
	PodDeleterInvalidPodSpecError  = VicPodDeleterError("PodDeleter called with nil pod")
)
View Source
const (
	PodStarterPortlayerClientError = VicPodStarterError("PodStarter called with an invalid portlayer client")
	PodStarterIsolationProxyError  = VicPodStarterError("PodStarter called with an invalid isolation proxy")
	PodStarterInvalidPodIDError    = VicPodStarterError("PodStarter called with invalid Pod ID")
	PodStarterInvalidPodNameError  = VicPodStarterError("PodStarter called with invalid Pod name")
)
View Source
const (
	PodStatusPortlayerClientError = VicPodStatusError("PodStatus called with an invalid portlayer client")
	PodStatusIsolationProxyError  = VicPodStatusError("PodStatus called with an invalid isolation proxy")
	PodStatusInvalidPodIDError    = VicPodStatusError("PodStatus called with invalid PodID")
	PodStatusInvalidPodNameError  = VicPodStatusError("PodStatus called with invalid PodName")
)
View Source
const (
	PodStopperPortlayerClientError = VicPodStopperError("PodStopper called with an invalid portlayer client")
	PodStopperIsolationProxyError  = VicPodStopperError("PodStopper called with an invalid isolation proxy")
	PodStopperInvalidPodIDError    = VicPodStopperError("PodStopper called with invalid PodID")
	PodStopperInvalidPodNameError  = VicPodStopperError("PodStopper called with invalid PodName")
)

Variables

This section is empty.

Functions

func IsolationContainerConfigFromKubeContainer

func IsolationContainerConfigFromKubeContainer(op trace.Operation, cSpec *v1.Container, imgConfig *metadata.ImageConfig, pod *v1.Pod) (proxy.IsolationContainerConfig, error)

Types

type DeleteResponse

type DeleteResponse struct {
	Id       string `json:"Id"`
	Warnings string `json:"Warnings"`
}

type PodCreator

type PodCreator interface {
	CreatePod(op trace.Operation, pod *v1.Pod, start bool) error
}

func NewPodCreator

func NewPodCreator(client *client.PortLayer, imageStore proxy.ImageStore, isolationProxy proxy.IsolationProxy, podCache cache.PodCache, personaAddr string, portlayerAddr string) (PodCreator, error)

type PodDeleter

type PodDeleter interface {
	DeletePod(op trace.Operation, pod *v1.Pod) error
}

func NewPodDeleter

func NewPodDeleter(client *client.PortLayer, isolationProxy proxy.IsolationProxy, podCache cache.PodCache, personaAddr string, portlayerAddr string) (PodDeleter, error)

type PodStarter

type PodStarter interface {
	Start(op trace.Operation, id, name string) error
}

func NewPodStarter

func NewPodStarter(client *client.PortLayer, isolationProxy proxy.IsolationProxy) (PodStarter, error)

type PodStatus added in v0.4.1

type PodStatus interface {
	GetStatus(op trace.Operation, namespace string, name string, hostAddress string) (*v1.PodStatus, error)
}

func NewPodStatus added in v0.4.1

func NewPodStatus(client *client.PortLayer, isolationProxy proxy.IsolationProxy) (PodStatus, error)

type PodStopper

type PodStopper interface {
	Stop(op trace.Operation, id, name string) error
}

func NewPodStopper

func NewPodStopper(client *client.PortLayer, isolationProxy proxy.IsolationProxy) (PodStopper, error)

type VicPodCreator

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

func (*VicPodCreator) CreatePod

func (v *VicPodCreator) CreatePod(op trace.Operation, pod *v1.Pod, start bool) error

CreatePod creates the pod and potentially start it

arguments:

op		operation trace logger
pod		pod spec
start	start the pod after creation

returns:

error

type VicPodCreatorError

type VicPodCreatorError string

func NewPodCreatorNilImgConfigError

func NewPodCreatorNilImgConfigError(image string) VicPodCreatorError

func NewPodCreatorPullError

func NewPodCreatorPullError(image, msg string) VicPodCreatorError

func (VicPodCreatorError) Error

func (e VicPodCreatorError) Error() string

type VicPodDeleter

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

func (*VicPodDeleter) DeletePod

func (v *VicPodDeleter) DeletePod(op trace.Operation, pod *v1.Pod) error

DeletePod deletes a pod

arguments:

op		operation trace logger
pod		pod spec

returns:

error

type VicPodDeleterError

type VicPodDeleterError string

func (VicPodDeleterError) Error

func (e VicPodDeleterError) Error() string

type VicPodStarter

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

func (*VicPodStarter) Start

func (v *VicPodStarter) Start(op trace.Operation, id, name string) error

Start starts up the pod vm

arguments:

op		operation trace logger
id		pod id
name	pod name

returns:

error

type VicPodStarterError

type VicPodStarterError string

func (VicPodStarterError) Error

func (e VicPodStarterError) Error() string

type VicPodStatus added in v0.4.1

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

func (*VicPodStatus) GetStatus added in v0.4.1

func (v *VicPodStatus) GetStatus(op trace.Operation, id, name string, hostAddress string) (*v1.PodStatus, error)

Gets pod status does not delete it

arguments:

op		operation trace logger
id		pod id
name	pod name

returns:

error

type VicPodStatusError added in v0.4.1

type VicPodStatusError string

func (VicPodStatusError) Error added in v0.4.1

func (e VicPodStatusError) Error() string

type VicPodStopper

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

func (*VicPodStopper) Stop

func (v *VicPodStopper) Stop(op trace.Operation, id, name string) error

Stop stops a pod but does not delete it

arguments:

op		operation trace logger
id		pod id
name	pod name

returns:

error

type VicPodStopperError

type VicPodStopperError string

func (VicPodStopperError) Error

func (e VicPodStopperError) Error() string

Jump to

Keyboard shortcuts

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