expect

package
v0.1.4-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppExpectation

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

AppExpectation is description of app, expected to run on EVE

func AppExpectationFromURL

func AppExpectationFromURL(ctrl controller.Cloud, device *device.Ctx, appLink string, podName string, opts ...ExpectationOption) (expectation *AppExpectation)

AppExpectationFromURL init AppExpectation with defined:

appLink - docker url to pull or link to qcow2 image or path to qcow2 image file
podName - name of app
device - device to set updates in volumes and content trees
opts can be used to modify parameters of expectation

func (*AppExpectation) Application

func (exp *AppExpectation) Application() *config.AppInstanceConfig

Application expectation gets or creates Image definition, gets or create NetworkInstance definition, gets AppInstanceConfig and returns it or creates AppInstanceConfig, adds it into internal controller and returns it

func (*AppExpectation) BaseOSImage

func (exp *AppExpectation) BaseOSImage() (baseOSConfig *config.BaseOSConfig)

BaseOSImage expectation gets or creates Image definition, gets BaseOSConfig and returns it or creates BaseOSConfig, adds it into internal controller and returns it

func (*AppExpectation) DataStore

func (exp *AppExpectation) DataStore() (datastore *config.DatastoreConfig)

DataStore expects datastore in controller it gets DatastoreConfig with defined in AppExpectation params, or creates new one, if not exists

func (*AppExpectation) Image

func (exp *AppExpectation) Image() (image *config.Image)

Image expects image in controller it gets Image with defined in AppExpectation params, or creates new one, if not exists

func (*AppExpectation) NetworkInstances

func (exp *AppExpectation) NetworkInstances() (networkInstances map[*NetInstanceExpectation]*config.NetworkInstanceConfig)

NetworkInstances expects network instances in cloud it iterates over NetworkInstanceConfigs from exp.netInstances, gets or creates new one, if not exists

func (*AppExpectation) Volume

func (exp *AppExpectation) Volume() *config.Volume

Volume generates volume for provided expectation

type ExpectationOption

type ExpectationOption func(expectation *AppExpectation)

ExpectationOption is type to use for creation of AppExpectation

func AddNetInstanceAndPortPublish

func AddNetInstanceAndPortPublish(subnetCidr string, networkType string, netInstanceName string, portPublish []string) ExpectationOption

AddNetInstanceAndPortPublish adds NetInstance with defined subnet cidr, networkType, netInstanceName and ports mapping for apps in format ["EXTERNAL_PORT:INTERNAL_PORT"]

func AddNetInstanceNameAndPortPublish

func AddNetInstanceNameAndPortPublish(netInstanceName string, portPublish []string) ExpectationOption

AddNetInstanceNameAndPortPublish adds NetInstance with defined name and ports mapping for apps in format ["EXTERNAL_PORT:INTERNAL_PORT"]

func WithACL

func WithACL(onlyHost bool) ExpectationOption

WithACL sets access for app only to external networks if onlyHost sets

func WithAppAdapters

func WithAppAdapters(appadapters []string) ExpectationOption

WithAppAdapters assigns adapters for created apps

func WithDiskSize

func WithDiskSize(diskSizeBytes int64) ExpectationOption

WithDiskSize set disk size for created app (equals with image size if not defined)

func WithImageFormat

func WithImageFormat(format string) ExpectationOption

WithImageFormat sets app format

func WithMetadata

func WithMetadata(metadata string) ExpectationOption

WithMetadata sets metadata for created apps

func WithOldApp

func WithOldApp(appName string) ExpectationOption

WithOldApp sets old app name to get info from

func WithPortsPublish

func WithPortsPublish(portPublish []string) ExpectationOption

WithPortsPublish sets ports mapping for apps in format ["EXTERNAL_PORT:INTERNAL_PORT"]

func WithRegistry

func WithRegistry(registry string) ExpectationOption

WithRegistry sets registry to use (remote/local)

func WithResources

func WithResources(cpus uint32, memory uint32) ExpectationOption

WithResources sets cpu count and memory for app

func WithVirtualizationMode

func WithVirtualizationMode(virtualizationMode config.VmMode) ExpectationOption

WithVirtualizationMode sets virtualizationMode for app

func WithVnc

func WithVnc(vncDisplay uint32) ExpectationOption

WithVnc enables VNC and sets VNC display number

func WithVncPassword

func WithVncPassword(password string) ExpectationOption

WithVncPassword sets VNC password

func WithVolumeType

func WithVolumeType(volumesType VolumeType) ExpectationOption

WithVolumeType sets empty volumes type for app

type NetInstanceExpectation

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

NetInstanceExpectation stores options for create NetworkInstanceConfigs for apps

type VolumeType

type VolumeType string

VolumeType defines type of empty volumes to use

var VolumeNone VolumeType = "none"

VolumeNone use no volumes

var VolumeOCI VolumeType = "oci"

VolumeOCI use empty oci image for volumes

var VolumeQcow2 VolumeType = "qcow2"

VolumeQcow2 use empty qcow2 image for volumes

var VolumeRaw VolumeType = "raw"

VolumeRaw use empty raw image for volumes

func VolumeTypeByName

func VolumeTypeByName(name string) VolumeType

VolumeTypeByName returns VolumeType by name

Jump to

Keyboard shortcuts

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