Documentation ¶
Index ¶
- Variables
- func IsErrNotRunning(err error) bool
- func PluginLoader(opts map[string]string) (map[string]interface{}, error)
- type ContainerGCConfig
- type DockerLogging
- type Driver
- func (d *Driver) Capabilities() (*drivers.Capabilities, error)
- func (d *Driver) ConfigSchema() (*hclspec.Spec, error)
- func (d *Driver) DestroyTask(taskID string, force bool) error
- func (d *Driver) ExecTask(taskID string, cmd []string, timeout time.Duration) (*drivers.ExecTaskResult, error)
- func (d *Driver) Fingerprint(ctx context.Context) (<-chan *drivers.Fingerprint, error)
- func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error)
- func (d *Driver) PluginInfo() (*base.PluginInfoResponse, error)
- func (d *Driver) RecoverTask(*drivers.TaskHandle) error
- func (d *Driver) SetConfig(c *base.Config) error
- func (d *Driver) SignalTask(taskID string, signal string) error
- func (d *Driver) StartTask(task *drivers.TaskConfig) (*drivers.TaskHandle, *drivers.DriverNetwork, error)
- func (d *Driver) StopTask(taskID string, timeout time.Duration, signal string) error
- func (d *Driver) TaskConfigSchema() (*hclspec.Spec, error)
- func (d *Driver) TaskEvents(ctx context.Context) (<-chan *drivers.TaskEvent, error)
- func (d *Driver) TaskStats(ctx context.Context, taskID string, interval time.Duration) (<-chan *cstructs.TaskResourceUsage, error)
- func (d *Driver) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.ExitResult, error)
- type DriverConfig
- type GCConfig
- type LogEventFn
- type TaskConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Version is set at compile time. Version = "0.0.0" PluginID = loader.PluginID{ Name: pluginName, PluginType: base.PluginTypeDriver, } )
Functions ¶
func IsErrNotRunning ¶
IsErrNotRunning checks an error if the container is not running.
Types ¶
type ContainerGCConfig ¶
type ContainerGCConfig struct { // Enabled controls whether the container reconciler is enabled Enabled bool `codec:"enabled"` // DryRun indicates that the reconciler should log unexpectedly running containers // if found without actually killing them DryRun bool `codec:"dry_run"` // Period controls the frequency of scanning containers Period string `codec:"period"` // CreationGrace is the duration allowed for newly created container // to live without being registered as a running task in nomad. // A container is treated as leaked if it lived more than a grace duration // and haven't been registered in tasks. CreationGrace string `codec:"creation_grace"` // contains filtered or unexported fields }
ContainerGCConfig controls the behavior of the GC reconcilier to detects dangling nomad containers that aren't tracked due to docker/nomad bugs.
type DockerLogging ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func NewDriver ¶
func NewDriver(logger hclog.Logger) *Driver
NewDriver retuns a docker implementation of a driver plugin
func (*Driver) Capabilities ¶
func (d *Driver) Capabilities() (*drivers.Capabilities, error)
func (*Driver) ConfigSchema ¶
ConfigSchema returns the schema for parsing the plugins configuration.
func (*Driver) Fingerprint ¶
func (*Driver) InspectTask ¶
func (d *Driver) InspectTask(taskID string) (*drivers.TaskStatus, error)
func (*Driver) PluginInfo ¶
func (d *Driver) PluginInfo() (*base.PluginInfoResponse, error)
PluginInfo describes the type and version of a plugin.
func (*Driver) RecoverTask ¶
func (d *Driver) RecoverTask(*drivers.TaskHandle) error
func (*Driver) SetConfig ¶
SetConfig is used to set the configuration by passing a MessagePack encoding of it.
func (*Driver) StartTask ¶
func (d *Driver) StartTask(task *drivers.TaskConfig) (*drivers.TaskHandle, *drivers.DriverNetwork, error)
func (*Driver) TaskEvents ¶
type DriverConfig ¶
type GCConfig ¶
type GCConfig struct { Image bool `codec:"image"` ImageDelay string `codec:"image_delay"` Container bool `codec:"container"` DanglingContainers ContainerGCConfig `codec:"dangling_containers"` // contains filtered or unexported fields }
type LogEventFn ¶
LogEventFn is a callback which allows Drivers to emit task events.
type TaskConfig ¶
type TaskConfig struct { Args []string `codec:"args"` CapAdd []string `codec:"cap_add"` CapDrop []string `codec:"cap_drop"` Command string `codec:"command"` DNSOptions []string `codec:"dns_options"` DNSSearchDomains []string `codec:"dns_search_domains"` DNSServers []string `codec:"dns_servers"` ForcePull bool `codec:"force_pull"` Image string `codec:"image"` Labels hclutils.MapStrStr `codec:"labels"` LoadImage string `codec:"load"` Logging DockerLogging `codec:"logging"` MacAddress string `codec:"mac_address"` PortMap hclutils.MapStrInt `codec:"port_map"` SecurityOpt []string `codec:"security_opt"` StorageOpt map[string]string `codec:"storage_opt"` WorkDir string `codec:"work_dir"` }
Click to show internal directories.
Click to hide internal directories.