Documentation ¶
Index ¶
- Constants
- Variables
- func EnvironmentVariablesToModel(envVars []EnvironmentVariable) []models.EnvironmentVariable
- type AllocationFailure
- type AllocationRequest
- type BindMountMode
- type CachedDependency
- type CertificateProperties
- type Client
- type Container
- func (newContainer Container) Copy() Container
- func (c *Container) HasTags(tags Tags) bool
- func (c *Container) IsCreated() bool
- func (c *Container) TransitionToComplete(failed bool, failureReason string, retryable bool)
- func (c *Container) TransitionToCreate() error
- func (c *Container) TransitionToInitialize(req *RunRequest) error
- func (c *Container) ValidateTransitionTo(newState State) bool
- type ContainerCompleteEvent
- type ContainerMetrics
- type ContainerReservedEvent
- type ContainerRunResult
- type ContainerRunningEvent
- type EnvironmentVariable
- type Error
- type Event
- type EventSource
- type EventType
- type ExecutorResources
- type InnerContainer
- type LifecycleEvent
- type LogConfig
- type Metrics
- type MetricsConfig
- type Network
- type PortMapping
- type ProxyPortMapping
- type Resource
- type RunInfo
- type RunRequest
- type Sidecar
- type State
- type Tags
- type UpdateRequest
- type VolumeMount
Constants ¶
View Source
const ( ContainerOwnerProperty = "executor:owner" ContainerStateProperty = "garden.state" )
View Source
const ( HealthcheckTag = "executor-healthcheck" HealthcheckTagValue = "executor-healthcheck" )
Variables ¶
View Source
var ( ErrContainerGuidNotAvailable = registerError("ContainerGuidNotAvailable", "container guid not available") ErrContainerNotCompleted = registerError("ContainerNotCompleted", "container must be stopped before it can be deleted") ErrInsufficientResourcesAvailable = registerError("InsufficientResourcesAvailable", "insufficient resources available") ErrContainerNotFound = registerError("ContainerNotFound", "container not found") ErrStepsInvalid = registerError("StepsInvalid", "steps invalid") ErrLimitsInvalid = registerError("LimitsInvalid", "container limits invalid") ErrGuidNotSpecified = registerError("GuidNotSpecified", "container guid not specified") ErrInvalidTransition = registerError("InvalidStateTransition", "container cannot transition to given state") ErrFailureToCheckSpace = registerError("ErrFailureToCheckSpace", "failed to check available space") ErrInvalidSecurityGroup = registerError("ErrInvalidSecurityGroup", "security group has invalid values") ErrNoProcessToStop = registerError("ErrNoProcessToStop", "failed to find a process to stop") )
View Source
var ErrUnknownEventType = errors.New("unknown event type")
View Source
var Errors = map[string]Error{}
Functions ¶
func EnvironmentVariablesToModel ¶
func EnvironmentVariablesToModel(envVars []EnvironmentVariable) []models.EnvironmentVariable
Types ¶
type AllocationFailure ¶
type AllocationFailure struct { AllocationRequest ErrorMsg string }
func NewAllocationFailure ¶
func NewAllocationFailure(req *AllocationRequest, msg string) AllocationFailure
func (*AllocationFailure) Error ¶
func (fail *AllocationFailure) Error() string
type AllocationRequest ¶
func NewAllocationRequest ¶
func NewAllocationRequest(guid string, resource *Resource, generateLogMetrics bool, tags Tags) AllocationRequest
func (*AllocationRequest) Validate ¶
func (a *AllocationRequest) Validate() error
type BindMountMode ¶ added in v0.1442.0
type BindMountMode uint8
const ( BindMountModeRO BindMountMode = 0 BindMountModeRW BindMountMode = 1 )
type CachedDependency ¶ added in v0.1442.0
type CertificateProperties ¶ added in v0.1442.0
type CertificateProperties struct {
OrganizationalUnit []string `json:"organizational_unit"`
}
type Client ¶
type Client interface { Ping(logger lager.Logger) error AllocateContainers(logger lager.Logger, traceID string, requests []AllocationRequest) []AllocationFailure GetContainer(logger lager.Logger, guid string) (Container, error) RunContainer(lager.Logger, string, *RunRequest) error UpdateContainer(lager.Logger, *UpdateRequest) error StopContainer(logger lager.Logger, traceID string, guid string) error DeleteContainer(logger lager.Logger, traceID string, guid string) error ListContainers(lager.Logger) ([]Container, error) GetBulkMetrics(lager.Logger) (map[string]Metrics, error) RemainingResources(lager.Logger) (ExecutorResources, error) TotalResources(lager.Logger) (ExecutorResources, error) GetFiles(logger lager.Logger, guid string, path string) (io.ReadCloser, error) VolumeDrivers(logger lager.Logger) ([]string, error) SubscribeToEvents(lager.Logger) (EventSource, error) Healthy(lager.Logger) bool SetHealthy(lager.Logger, bool) Cleanup(lager.Logger) }
type Container ¶
type Container struct { Guid string `json:"guid"` Resource RunInfo Tags Tags State State `json:"state"` Routable bool `json:"routable"` AllocatedAt int64 `json:"allocated_at"` ExternalIP string `json:"external_ip"` InternalIP string `json:"internal_ip"` RunResult ContainerRunResult `json:"run_result"` MemoryLimit uint64 `json:"memory_limit"` DiskLimit uint64 `json:"disk_limit"` AdvertisePreferenceForInstanceAddress bool `json:"advertise_preference_for_instance_address"` }
func NewReservedContainerFromAllocationRequest ¶
func NewReservedContainerFromAllocationRequest(req *AllocationRequest, allocatedAt int64) Container
func (*Container) TransitionToComplete ¶ added in v0.1442.0
func (*Container) TransitionToCreate ¶ added in v0.1442.0
func (*Container) TransitionToInitialize ¶ added in v0.1442.0
func (c *Container) TransitionToInitialize(req *RunRequest) error
func (*Container) ValidateTransitionTo ¶ added in v0.1442.0
type ContainerCompleteEvent ¶
type ContainerCompleteEvent struct { RawContainer Container `json:"container"` // contains filtered or unexported fields }
func NewContainerCompleteEvent ¶
func NewContainerCompleteEvent(container Container, traceID string) ContainerCompleteEvent
func (ContainerCompleteEvent) Container ¶
func (e ContainerCompleteEvent) Container() Container
func (ContainerCompleteEvent) EventType ¶
func (ContainerCompleteEvent) EventType() EventType
func (ContainerCompleteEvent) TraceID ¶ added in v0.1442.0
func (e ContainerCompleteEvent) TraceID() string
type ContainerMetrics ¶
type ContainerMetrics struct { MemoryUsageInBytes uint64 `json:"memory_usage_in_bytes"` DiskUsageInBytes uint64 `json:"disk_usage_in_bytes"` MemoryLimitInBytes uint64 `json:"memory_limit_in_bytes"` DiskLimitInBytes uint64 `json:"disk_limit_in_bytes"` TimeSpentInCPU time.Duration `json:"time_spent_in_cpu"` AbsoluteCPUEntitlementInNanoseconds uint64 `json:"absolute_cpu_entitlement_in_ns"` ContainerAgeInNanoseconds uint64 `json:"container_age_in_ns"` RxInBytes *uint64 `json:"rx_in_bytes"` TxInBytes *uint64 `json:"tx_in_bytes"` }
type ContainerReservedEvent ¶
type ContainerReservedEvent struct { RawContainer Container `json:"container"` // contains filtered or unexported fields }
func NewContainerReservedEvent ¶
func NewContainerReservedEvent(container Container, traceID string) ContainerReservedEvent
func (ContainerReservedEvent) Container ¶
func (e ContainerReservedEvent) Container() Container
func (ContainerReservedEvent) EventType ¶
func (ContainerReservedEvent) EventType() EventType
func (ContainerReservedEvent) TraceID ¶ added in v0.1442.0
func (e ContainerReservedEvent) TraceID() string
type ContainerRunResult ¶
type ContainerRunningEvent ¶
type ContainerRunningEvent struct { RawContainer Container `json:"container"` // contains filtered or unexported fields }
func NewContainerRunningEvent ¶
func NewContainerRunningEvent(container Container, traceID string) ContainerRunningEvent
func (ContainerRunningEvent) Container ¶
func (e ContainerRunningEvent) Container() Container
func (ContainerRunningEvent) EventType ¶
func (ContainerRunningEvent) EventType() EventType
func (ContainerRunningEvent) TraceID ¶ added in v0.1442.0
func (e ContainerRunningEvent) TraceID() string
type EnvironmentVariable ¶
func EnvironmentVariablesFromModel ¶
func EnvironmentVariablesFromModel(envVars []*models.EnvironmentVariable) []EnvironmentVariable
type EventSource ¶
type ExecutorResources ¶
type ExecutorResources struct { MemoryMB int `json:"memory_mb"` DiskMB int `json:"disk_mb"` Containers int `json:"containers"` }
func NewExecutorResources ¶
func NewExecutorResources(memoryMB, diskMB, containers int) ExecutorResources
func (*ExecutorResources) Add ¶ added in v0.1442.0
func (r *ExecutorResources) Add(res *Resource)
func (ExecutorResources) Copy ¶ added in v0.1442.0
func (e ExecutorResources) Copy() ExecutorResources
func (*ExecutorResources) Subtract ¶
func (r *ExecutorResources) Subtract(res *Resource) bool
type InnerContainer ¶
type InnerContainer Container
type LifecycleEvent ¶
type LogConfig ¶
type Metrics ¶
type Metrics struct { MetricsConfig ContainerMetrics }
type MetricsConfig ¶
type PortMapping ¶
type ProxyPortMapping ¶ added in v0.1442.0
type Resource ¶
type Resource struct { MemoryMB int `json:"memory_mb"` DiskMB int `json:"disk_mb"` MaxPids int `json:"max_pids"` }
func NewResource ¶
type RunInfo ¶
type RunInfo struct { RootFSPath string `json:"rootfs"` CPUWeight uint `json:"cpu_weight"` Ports []PortMapping `json:"ports"` InternalRoutes internalroutes.InternalRoutes `json:"internal_routes"` LogConfig LogConfig `json:"log_config"` MetricsConfig MetricsConfig `json:"metrics_config"` StartTimeoutMs uint `json:"start_timeout_ms"` Privileged bool `json:"privileged"` CachedDependencies []CachedDependency `json:"cached_dependencies"` Setup *models.Action `json:"setup"` Action *models.Action `json:"run"` Monitor *models.Action `json:"monitor"` CheckDefinition *models.CheckDefinition `json:"check_definition"` EgressRules []*models.SecurityGroupRule `json:"egress_rules,omitempty"` Env []EnvironmentVariable `json:"env,omitempty"` TrustedSystemCertificatesPath string `json:"trusted_system_certificates_path,omitempty"` VolumeMounts []VolumeMount `json:"volume_mounts"` Network *Network `json:"network,omitempty"` CertificateProperties CertificateProperties `json:"certificate_properties"` ImageUsername string `json:"image_username"` ImagePassword string `json:"image_password"` EnableContainerProxy bool `json:"enable_container_proxy"` Sidecars []Sidecar `json:"sidecars"` LogRateLimitBytesPerSecond int64 `json:"log_rate_limit_bytes_per_second"` }
type RunRequest ¶
func NewRunRequest ¶
func NewRunRequest(guid string, runInfo *RunInfo, tags Tags) RunRequest
type UpdateRequest ¶ added in v0.1442.0
type UpdateRequest struct { Guid string InternalRoutes internalroutes.InternalRoutes MetricTags map[string]string }
func NewUpdateRequest ¶ added in v0.1442.0
func NewUpdateRequest(guid string, internalRoutes internalroutes.InternalRoutes, metricTags map[string]string) UpdateRequest
type VolumeMount ¶ added in v0.1442.0
type VolumeMount struct { Driver string `json:"driver"` VolumeId string `json:"volume_id"` Config map[string]interface{} `json:"config"` ContainerPath string `json:"container_path"` Mode BindMountMode `json:"mode"` }
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
containerstore/containerstorefakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
event/fakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
log_streamer/fake_log_streamer
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
transformer/faketransformer
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
uploader/fake_uploader
This file was generated by counterfeiter
|
This file was generated by counterfeiter |
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
Package gardenhealth contains logic to periodically verify that basic garden container functionality is working.
|
Package gardenhealth contains logic to periodically verify that basic garden container functionality is working. |
fakegardenhealth
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
fakeguidgen
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
configuration/configurationfakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
fakes
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
Click to show internal directories.
Click to hide internal directories.