proxy

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ImageStorePortlayerClientError = ImageStoreError("ImageStore cannot be created without a valid portlayer client")
	ImageStorePersonaAddrError     = ImageStoreError("ImageStore cannot be created without a valid VIC persona addr")
	ImageStorePortlayerAddrError   = ImageStoreError("ImageStore cannot be created without a valid VIC portlayer addr")
	ImageStoreContainerIDError     = ImageStoreError("ImageStore called with empty container ID")
	ImageStoreEmptyUserNameError   = ImageStoreError("ImageStore called with empty username")
	ImageStoreEmptyPasswordError   = ImageStoreError("ImageStore called with empty password")
)

Variables

This section is empty.

Functions

func IsolationContainerConfigToTask

func IsolationContainerConfigToTask(op trace.Operation, id, layerID string, ic IsolationContainerConfig) *tasks.JoinParams

Convert isolation container config to portlayer task param

Types

type ImageStore

type ImageStore interface {
	Get(op trace.Operation, idOrRef, tag string, actuate bool) (*metadata.ImageConfig, error)
	GetImages(op trace.Operation) []*metadata.ImageConfig
	PullImage(op trace.Operation, image, tag, username, password string) error
}

func NewImageStore

func NewImageStore(plClient *client.PortLayer, personaAddr, portlayerAddr string) (ImageStore, error)

type ImageStoreError

type ImageStoreError string

func (ImageStoreError) Error

func (e ImageStoreError) Error() string

type IsolationContainerConfig

type IsolationContainerConfig struct {
	ID        string
	ImageID   string
	LayerID   string
	ImageName string
	Name      string
	Namespace string

	Cmd        []string
	Path       string
	Entrypoint []string
	//Args       []string
	Env        []string
	WorkingDir string
	User       string
	StopSignal string

	Attach    bool
	StdinOnce bool
	OpenStdin bool
	Tty       bool

	CPUCount int64
	Memory   int64

	PortMap map[string]PortBinding
}

type IsolationProxy

type IsolationProxy interface {
	CreateHandle(op trace.Operation) (string, string, error)
	AddImageToHandle(op trace.Operation, handle, deltaID, layerID, imageID, imageName string) (string, error)
	CreateHandleTask(op trace.Operation, handle, id, layerID string, config IsolationContainerConfig) (string, error)
	AddHandleToScope(op trace.Operation, handle string, config IsolationContainerConfig) (string, error)
	AddInteractionToHandle(op trace.Operation, handle string) (string, error)
	AddLoggingToHandle(op trace.Operation, handle string) (string, error)
	CommitHandle(op trace.Operation, handle, containerID string, waitTime int32) error
	SetState(op trace.Operation, handle, name, state string) (string, error)

	BindScope(op trace.Operation, handle string, name string) (string, interface{}, error)
	UnbindScope(op trace.Operation, handle string, name string) (string, interface{}, error)

	Handle(op trace.Operation, id, name string) (string, error)
	Remove(op trace.Operation, id string, force bool) error

	State(op trace.Operation, id, name string) (string, error)
	EpAddresses(op trace.Operation, id, name string) ([]string, error)
}

func NewIsolationProxy

func NewIsolationProxy(plClient *client.PortLayer, portlayerAddr string, hostUUID string, imageStore ImageStore, podCache cache.PodCache) IsolationProxy

type PortBinding

type PortBinding struct {
	HostIP   string
	HostPort string
}

type VicImageStore

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

func (*VicImageStore) Get

func (v *VicImageStore) Get(op trace.Operation, idOrRef, tag string, realize bool) (*metadata.ImageConfig, error)

Get retrieves the VIC ImageConfig data structure. If the config is not cached, VicImageStore can request imagec to pull the image if actuate is set to true.

arguments:

op		operation trace logger
idOrRef	docker image id or reference
tag		docker image tag
realize	determines whether the image is pulled if not in the cache

returns:

error

func (*VicImageStore) GetImages

func (v *VicImageStore) GetImages(op trace.Operation) []*metadata.ImageConfig

Get retrieves all the VIC ImageConfig data structure.

arguments:

op		operation trace logger

returns:

array of ImageConfig

func (*VicImageStore) PullImage

func (v *VicImageStore) PullImage(op trace.Operation, image, tag, username, password string) error

PullImage makes a request to the VIC persona server (imageC component) to retrieve a container image.

arguments:

op			operation trace logger
idOrRef		docker image id or reference
tag			docker image tag
username	user name for the registry server
password	password for the registry server

returns:

array of ImageConfig

type VicIsolationProxy

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

func (*VicIsolationProxy) AddHandleToScope

func (v *VicIsolationProxy) AddHandleToScope(op trace.Operation, handle string, config IsolationContainerConfig) (string, error)

AddHandleToScope adds a container, referenced by handle, to a scope. If an error is return, the returned handle should not be used.

returns:

modified handle

func (*VicIsolationProxy) AddImageToHandle

func (v *VicIsolationProxy) AddImageToHandle(op trace.Operation, handle, deltaID, layerID, imageID, imageName string) (string, error)

func (*VicIsolationProxy) AddInteractionToHandle

func (v *VicIsolationProxy) AddInteractionToHandle(op trace.Operation, handle string) (string, error)

AddInteractionToContainer adds interaction capabilities to a container, referenced by handle. If an error is return, the returned handle should not be used.

returns:

modified handle

func (*VicIsolationProxy) AddLoggingToHandle

func (v *VicIsolationProxy) AddLoggingToHandle(op trace.Operation, handle string) (string, error)

AddLoggingToHandle adds logging capability to the isolation vm, referenced by handle. If an error is return, the returned handle should not be used.

returns:

modified handle

func (*VicIsolationProxy) BindScope

func (v *VicIsolationProxy) BindScope(op trace.Operation, handle string, name string) (string, interface{}, error)

TODO: I don't think this function should be in here. BindNetwork binds the handle to the scope and returns endpoints. Caller of the function does not need to interpret the return value. In the event the caller want to unbind,

func (*VicIsolationProxy) CommitHandle

func (v *VicIsolationProxy) CommitHandle(op trace.Operation, handle, containerID string, waitTime int32) error

func (*VicIsolationProxy) CreateHandle

func (v *VicIsolationProxy) CreateHandle(op trace.Operation) (string, string, error)

CreateHandle creates a "manifest" that will be used by Commit() to create the actual isolation vm.

returns:

(container/pod id, handle, error)

func (*VicIsolationProxy) CreateHandleTask

func (v *VicIsolationProxy) CreateHandleTask(op trace.Operation, handle, id, layerID string, config IsolationContainerConfig) (string, error)

func (*VicIsolationProxy) EpAddresses added in v0.4.1

func (v *VicIsolationProxy) EpAddresses(op trace.Operation, id, name string) ([]string, error)

func (*VicIsolationProxy) Handle

func (v *VicIsolationProxy) Handle(op trace.Operation, id, name string) (string, error)

Handle retrieves a handle to a VIC container. Handles should be treated as opaque strings.

returns:

(handle string, error)

func (*VicIsolationProxy) Remove

func (v *VicIsolationProxy) Remove(op trace.Operation, id string, force bool) error

func (*VicIsolationProxy) SetState

func (v *VicIsolationProxy) SetState(op trace.Operation, handle, name, state string) (string, error)

SetState adds the desire state of the isolation unit once the handle is commited.

returns handle string and error

func (*VicIsolationProxy) State

func (v *VicIsolationProxy) State(op trace.Operation, id, name string) (string, error)

func (*VicIsolationProxy) UnbindScope

func (v *VicIsolationProxy) UnbindScope(op trace.Operation, handle string, name string) (string, interface{}, error)

Directories

Path Synopsis
Code generated by mockery v1.0.0.
Code generated by mockery v1.0.0.

Jump to

Keyboard shortcuts

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