Documentation ¶
Index ¶
- Variables
- func GetAbsolutePath(bin string) (string, error)
- func NewRktDriver(logger hclog.Logger) drivers.DriverPlugin
- func PluginLoader(opts map[string]string) (map[string]interface{}, error)
- type Config
- 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, cmdArgs []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(handle *drivers.TaskHandle) error
- func (d *Driver) SetConfig(cfg *base.Config) error
- func (d *Driver) Shutdown()
- func (d *Driver) SignalTask(taskID string, signal string) error
- func (d *Driver) StartTask(cfg *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 *drivers.TaskResourceUsage, error)
- func (d *Driver) WaitTask(ctx context.Context, taskID string) (<-chan *drivers.ExitResult, error)
- type NetInfo
- type Pod
- type TaskConfig
- type TaskState
Constants ¶
This section is empty.
Variables ¶
var ( // PluginID is the rawexec plugin metadata registered in the plugin // catalog. PluginID = loader.PluginID{ Name: pluginName, PluginType: base.PluginTypeDriver, } // PluginConfig is the rawexec factory function registered in the // plugin catalog. PluginConfig = &loader.InternalPluginConfig{ Config: map[string]interface{}{}, Factory: func(l hclog.Logger) interface{} { return NewRktDriver(l) }, } )
Functions ¶
func GetAbsolutePath ¶
GetAbsolutePath returns the absolute path of the passed binary by resolving it in the path and following symlinks.
func NewRktDriver ¶
func NewRktDriver(logger hclog.Logger) drivers.DriverPlugin
Types ¶
type Config ¶
type Config struct { // VolumesEnabled allows tasks to bind host paths (volumes) inside their // container. Binding relative paths is always allowed and will be resolved // relative to the allocation's directory. VolumesEnabled bool `codec:"volumes_enabled"` }
Config is the client configuration for the driver
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver is a driver for running images via Rkt We attempt to chose sane defaults for now, with more configuration available planned in the future.
func (*Driver) Capabilities ¶
func (d *Driver) Capabilities() (*drivers.Capabilities, error)
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)
func (*Driver) RecoverTask ¶
func (d *Driver) RecoverTask(handle *drivers.TaskHandle) error
func (*Driver) StartTask ¶
func (d *Driver) StartTask(cfg *drivers.TaskConfig) (*drivers.TaskHandle, *drivers.DriverNetwork, error)
func (*Driver) TaskEvents ¶
type NetInfo ¶
type NetInfo struct { NetName string `json:"netName"` ConfPath string `json:"netConf"` PluginPath string `json:"pluginPath"` IfName string `json:"ifName"` IP net.IP `json:"ip"` Args string `json:"args"` }
A type and some structure to represent rkt's view of a *runtime* network instance. https://github.com/rkt/rkt/blob/4080b1743e0c46fa1645f4de64f1b75a980d82a3/networking/netinfo/netinfo.go#L29-L48
type Pod ¶
type Pod struct { UUID string `json:"name"` State string `json:"state"` Networks []NetInfo `json:"networks,omitempty"` }
Pod is the pod object, as defined in https://github.com/rkt/rkt/blob/03285a7db960311faf887452538b2b8ae4304488/api/v1/json.go#L68-L88
type TaskConfig ¶
type TaskConfig struct { ImageName string `codec:"image"` Command string `codec:"command"` Args []string `codec:"args"` TrustPrefix string `codec:"trust_prefix"` DNSServers []string `codec:"dns_servers"` // DNS Server for containers DNSSearchDomains []string `codec:"dns_search_domains"` // DNS Search domains for containers Net []string `codec:"net"` // Networks for the containers PortMap map[string]string `codec:"port_map"` // A map of host port and the port name defined in the image manifest file Volumes []string `codec:"volumes"` // Host-Volumes to mount in, syntax: /path/to/host/directory:/destination/path/in/container[:readOnly] InsecureOptions []string `codec:"insecure_options"` // list of args for --insecure-options NoOverlay bool `codec:"no_overlay"` // disable overlayfs for rkt run Debug bool `codec:"debug"` // Enable debug option for rkt command Group string `codec:"group"` // Group override for the container }
TaskConfig is the driver configuration of a taskConfig within a job
type TaskState ¶
type TaskState struct { ReattachConfig *pstructs.ReattachConfig TaskConfig *drivers.TaskConfig Pid int StartedAt time.Time UUID string }
TaskState is the state which is encoded in the handle returned in StartTask. This information is needed to rebuild the taskConfig state and handler during recovery.