container

package
v0.0.0-...-9050134 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

container stores objects related to containers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Name            string
	ImageHash       string
	Image           string                `json:"image"`
	Environment     map[string]string     `json:"environment"`
	Exec            string                `json:"exec"`
	StateConditions state.StateConditions `json:"state_conditions"`
	Mounts          []Mount               `json:"mounts"`
	DependsStrings  []string              `json:"depends_on"`
	DependsOn       map[string]*Container
	Ports           []*Port
}

Container stores all the information about a container to operate on

func (*Container) GetDepChainIPs

func (container *Container) GetDepChainIPs(projectName string, runningPods rkt.Pods, logger *log.Logger) (map[string][]string, error)

getDependencyChainIPs will return a map of container name=>IP of each dependency of the container and each of their dependencies

func (*Container) Init

func (container *Container) Init(containers map[string]*Container, volumes map[string]types.Volume) error

Init will do the inital checking of a container to make sure it's viable. We also pull the images. We can also do initial container setup here if we want (though we don't right now)

func (*Container) Run

func (container *Container) Run(configPath string, projectName string, volumes map[string]types.Volume, hostsEntries []types.HostsEntry) error

Run will run a container. It will return an error message if the container fails by any of the containers StateConditions

type Mount

type Mount struct {
	Volume string
	Path   string
}

Mount defines a volume that is mounted into a container

func (*Mount) GenerateCommandLine

func (mount *Mount) GenerateCommandLine() []string

type Port

type Port struct {
	rkt.ImageAppPort
	HostPort int
}

Port represents a port that is defined in a container manifest. We ingest all the values even though we only use a few.

func (*Port) GenerateCommandLine

func (port *Port) GenerateCommandLine() []string

GenerateCommandLine will generate the command line options to use this port

func (*Port) SetHostPort

func (port *Port) SetHostPort() error

SetHostPort will get a free port on the host machine and save it as the mapped port. You want to do this as close to the actual running of the command as possible to avoid potential conflicts

Jump to

Keyboard shortcuts

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