restaskdocker

package
v0.0.0-...-20c3210 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Keywords = []keywords.Keyword{
		{
			Option:        "schedule",
			DefaultOption: "run_schedule",
			Attr:          "Schedule",
			Scopable:      true,
			Text:          keywords.NewText(fs, "text/kw/schedule"),
			Example:       "00:00-01:00 mon",
		},
		{
			Option:    "timeout",
			Attr:      "StartTimeout",
			Converter: converters.Duration,
			Scopable:  true,
			Text:      keywords.NewText(fs, "text/kw/timeout"),
			Example:   "5m",
		},
		{
			Option:    "snooze",
			Attr:      "Snooze",
			Converter: converters.Duration,
			Scopable:  true,
			Example:   "10m",
			Text:      keywords.NewText(fs, "text/kw/snooze"),
		},
		{
			Option:    "log",
			Attr:      "LogOutputs",
			Converter: converters.Bool,
			Text:      keywords.NewText(fs, "text/kw/log"),
		},
		{
			Option:     "check",
			Attr:       "Check",
			Candidates: []string{"last_run", ""},
			Scopable:   true,
			Example:    "last_run",
			Text:       keywords.NewText(fs, "text/kw/check"),
		},
		{
			Option:    "confirmation",
			Attr:      "Confirmation",
			Converter: converters.Bool,
			Text:      keywords.NewText(fs, "text/kw/confirmation"),
		},
		{
			Option:      "name",
			Attr:        "Name",
			Scopable:    true,
			DefaultText: keywords.NewText(fs, "text/kw/name.default"),
			Text:        keywords.NewText(fs, "text/kw/name"),
			Example:     "osvcprd..rundeck.container.db",
		},
		{
			Option:   "hostname",
			Attr:     "Hostname",
			Scopable: true,
			Example:  "nginx1",
			Text:     keywords.NewText(fs, "text/kw/hostname"),
		},
		{
			Option:    "dns_search",
			Attr:      "DNSSearch",
			Converter: converters.List,
			Aliases:   []string{},
			Scopable:  true,
			Required:  false,
			Example:   "opensvc.com",
			Text:      keywords.NewText(fs, "text/kw/dns_search"),
		},
		{
			Option:   "image",
			Attr:     "Image",
			Aliases:  []string{"run_image"},
			Scopable: true,
			Required: true,
			Example:  "google/pause",
			Text:     keywords.NewText(fs, "text/kw/image"),
		},
		{
			Option:     "image_pull_policy",
			Attr:       "ImagePullPolicy",
			Scopable:   true,
			Candidates: []string{"once", "always"},
			Example:    "once",
			Text:       keywords.NewText(fs, "text/kw/virtinst"),
		},
		{
			Option:   "cwd",
			Attr:     "CWD",
			Scopable: true,
			Example:  "/opt/foo",
			Text:     keywords.NewText(fs, "text/kw/cwd"),
		},
		{
			Option:    "command",
			Attr:      "Command",
			Aliases:   []string{"run_command"},
			Scopable:  true,
			Converter: converters.Shlex,
			Example:   "/opt/tomcat/bin/catalina.sh",
			Text:      keywords.NewText(fs, "text/kw/command"),
		},
		{
			Option:    "run_args",
			Attr:      "RunArgs",
			Scopable:  true,
			Converter: converters.Shlex,
			Example:   "-v /opt/docker.opensvc.com/vol1:/vol1:rw -p 37.59.71.25:8080:8080",
			Text:      keywords.NewText(fs, "text/kw/run_args"),
		},
		{
			Option:    "entrypoint",
			Attr:      "Entrypoint",
			Scopable:  true,
			Converter: converters.Shlex,
			Example:   "/bin/sh",
			Text:      keywords.NewText(fs, "text/kw/entrypoint"),
		},
		{
			Option:    "detach",
			Attr:      "Detach",
			Scopable:  true,
			Converter: converters.Bool,
			Default:   "true",
			Text:      keywords.NewText(fs, "text/kw/detach"),
		},
		{
			Option:    "rm",
			Attr:      "Remove",
			Scopable:  true,
			Converter: converters.Bool,
			Example:   "false",
			Text:      keywords.NewText(fs, "text/kw/rm"),
		},
		{
			Option:    "privileged",
			Attr:      "Privileged",
			Scopable:  true,
			Converter: converters.Bool,
			Text:      keywords.NewText(fs, "text/kw/privileged"),
		},
		{
			Option:    "init",
			Attr:      "Init",
			Scopable:  true,
			Default:   "true",
			Converter: converters.Bool,
			Text:      keywords.NewText(fs, "text/kw/init"),
		},
		{
			Option:    "interactive",
			Attr:      "Interactive",
			Scopable:  true,
			Converter: converters.Bool,
			Text:      keywords.NewText(fs, "text/kw/interactive"),
		},
		{
			Option:    "tty",
			Attr:      "TTY",
			Scopable:  true,
			Converter: converters.Bool,
			Text:      keywords.NewText(fs, "text/kw/tty"),
		},
		{
			Option:    "volume_mounts",
			Attr:      "VolumeMounts",
			Scopable:  true,
			Converter: converters.Shlex,
			Example:   "myvol1:/vol1 myvol2:/vol2:rw /localdir:/data:ro",
			Text:      keywords.NewText(fs, "text/kw/volume_mounts"),
		},
		{
			Option:    "environment",
			Attr:      "Env",
			Scopable:  true,
			Converter: converters.Shlex,
			Text:      keywords.NewText(fs, "text/kw/environment"),
			Example:   "KEY=cert1/server.key PASSWORD=db/password",
		},
		{
			Option:    "configs_environment",
			Attr:      "ConfigsEnv",
			Scopable:  true,
			Converter: converters.Shlex,
			Text:      keywords.NewText(fs, "text/kw/configs_environment"),
			Example:   "CRT=cert1/server.crt PEM=cert1/server.pem",
		},
		{
			Option:    "devices",
			Attr:      "Devices",
			Scopable:  true,
			Converter: converters.Shlex,
			Text:      keywords.NewText(fs, "text/kw/devices"),
			Example:   "myvol1:/dev/xvda myvol2:/dev/xvdb",
		},
		{
			Option:   "netns",
			Attr:     "NetNS",
			Aliases:  []string{"net"},
			Scopable: true,
			Example:  "container#0",
			Text:     keywords.NewText(fs, "text/kw/netns"),
		},
		{
			Option:   "user",
			Attr:     "User",
			Scopable: true,
			Example:  "guest",
			Text:     keywords.NewText(fs, "text/kw/user"),
		},
		{
			Option:   "userns",
			Attr:     "UserNS",
			Scopable: true,
			Example:  "container#0",
			Text:     keywords.NewText(fs, "text/kw/userns"),
		},
		{
			Option:   "pidns",
			Attr:     "PIDNS",
			Scopable: true,
			Example:  "container#0",
			Text:     keywords.NewText(fs, "text/kw/pidns"),
		},
		{
			Option:   "ipcns",
			Attr:     "IPCNS",
			Scopable: true,
			Example:  "container#0",
			Text:     keywords.NewText(fs, "text/kw/ipcns"),
		},
		{
			Option:     "utsns",
			Attr:       "UTSNS",
			Scopable:   true,
			Candidates: []string{"", "host"},
			Example:    "container#0",
			Text:       keywords.NewText(fs, "text/kw/utsns"),
		},
		{
			Option:   "registry_creds",
			Attr:     "RegistryCreds",
			Scopable: true,
			Example:  "creds-registry-opensvc-com",
			Text:     keywords.NewText(fs, "text/kw/registry_creds"),
		},
		{
			Option:    "pull_timeout",
			Attr:      "PullTimeout",
			Scopable:  true,
			Converter: converters.Duration,
			Text:      keywords.NewText(fs, "text/kw/pull_timeout"),
			Example:   "2m",
			Default:   "2m",
		},
		{
			Option:    "start_timeout",
			Attr:      "StartTimeout",
			Scopable:  true,
			Converter: converters.Duration,
			Text:      keywords.NewText(fs, "text/kw/start_timeout"),
			Example:   "1m5s",
			Default:   "5s",
		},
		{
			Option:    "stop_timeout",
			Attr:      "StopTimeout",
			Scopable:  true,
			Converter: converters.Duration,
			Text:      keywords.NewText(fs, "text/kw/stop_timeout"),
			Example:   "2m",
			Default:   "2m30s",
		},
		{
			Option:    "secrets_environment",
			Attr:      "SecretsEnv",
			Scopable:  true,
			Converter: converters.Shlex,
			Text:      keywords.NewText(fs, "text/kw/secrets_environment"),
			Example:   "CRT=cert1/server.pem sec1/*",
		},
		{
			Option:    "configs_environment",
			Attr:      "ConfigsEnv",
			Scopable:  true,
			Converter: converters.Shlex,
			Text:      keywords.NewText(fs, "text/kw/configs_environment"),
			Example:   "PORT=http/port webapp/app1* {name}/* {name}-debug/settings",
		},
		{
			Option:   "retcodes",
			Attr:     "RetCodes",
			Scopable: true,
			Required: false,
			Text:     keywords.NewText(fs, "text/kw/retcodes"),
			Default:  "0:up 1:down",
			Example:  "0:up 1:down 3:warn 4: n/a 5:undef",
		},
		rescontainer.KWOsvcRootPath,
		rescontainer.KWGuestOS,
	}
)

Functions

func New

func New() resource.Driver

Types

type T

type T struct {
	resource.T
	resource.SCSIPersistentReservation
	Detach          bool           `json:"detach"`
	PG              pg.Config      `json:"pg"`
	Path            naming.Path    `json:"path"`
	ObjectID        uuid.UUID      `json:"object_id"`
	SCSIReserv      bool           `json:"scsireserv"`
	PromoteRW       bool           `json:"promote_rw"`
	NoPreemptAbort  bool           `json:"no_preempt_abort"`
	OsvcRootPath    string         `json:"osvc_root_path"`
	GuestOS         string         `json:"guest_os"`
	Name            string         `json:"name"`
	Nodes           []string       `json:"nodes"`
	Hostname        string         `json:"hostname"`
	Image           string         `json:"image"`
	ImagePullPolicy string         `json:"image_pull_policy"`
	CWD             string         `json:"cwd"`
	User            string         `json:"user"`
	Command         []string       `json:"command"`
	DNS             []string       `json:"dns"`
	DNSSearch       []string       `json:"dns_search"`
	RunArgs         []string       `json:"run_args"`
	Entrypoint      []string       `json:"entrypoint"`
	Remove          bool           `json:"remove"`
	Privileged      bool           `json:"privileged"`
	Init            bool           `json:"init"`
	Interactive     bool           `json:"interactive"`
	TTY             bool           `json:"tty"`
	VolumeMounts    []string       `json:"volume_mounts"`
	Env             []string       `json:"environment"`
	SecretsEnv      []string       `json:"secrets_environment"`
	ConfigsEnv      []string       `json:"configs_environment"`
	Devices         []string       `json:"devices"`
	NetNS           string         `json:"netns"`
	UserNS          string         `json:"userns"`
	PIDNS           string         `json:"pidns"`
	IPCNS           string         `json:"ipcns"`
	UTSNS           string         `json:"utsns"`
	RegistryCreds   string         `json:"registry_creds"`
	PullTimeout     *time.Duration `json:"pull_timeout"`
	StartTimeout    *time.Duration `json:"start_timeout"`
	StopTimeout     *time.Duration `json:"stop_timeout"`

	RetCodes string `json:"retcodes"`

	Check        string
	Schedule     string
	Confirmation bool
	LogOutputs   bool
	Snooze       *time.Duration
}

T is the driver structure.

func (T) Container

func (t T) Container() *rescontainerdocker.T

func (T) ExitCodeToStatus

func (t T) ExitCodeToStatus(exitCode int) (status.T, error)

func (T) IsRunning

func (t T) IsRunning() bool

func (*T) Kill

func (t *T) Kill(ctx context.Context) error

func (T) Label

func (t T) Label() string

Label returns a formatted short description of the Resource

func (T) Manifest

func (t T) Manifest() *manifest.T

Manifest ...

func (T) Run

func (t T) Run(ctx context.Context) error

func (T) ScheduleOptions

func (t T) ScheduleOptions() resource.ScheduleOptions

func (*T) Status

func (t *T) Status(ctx context.Context) status.T

Jump to

Keyboard shortcuts

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