local

package
v0.18.13 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unknown status = iota
	Running status = iota
	Done    status = iota
	Error   status = iota
)

Variables

View Source
var DefaultGracePeriod = 30 * time.Second
View Source
var ErrUnsupportedProbeType = errors.New("unsupported probe type")

Functions

func HandleCmdCreateAction added in v0.18.12

func HandleCmdCreateAction(state *store.EngineState, action CmdCreateAction)

When the local controller creates a new command, link that command to the Local runtime state.

func HandleCmdUpdateAction added in v0.18.12

func HandleCmdUpdateAction(state *store.EngineState, action CmdUpdateAction)

When the Cmd controller updates a command, check to see what parts of the EngineState care about that command.

If the local serve cmd is watching the cmd, update the local runtime state to match the cmd status.

func NewProcessExecer

func NewProcessExecer() *processExecer

func SpanIDForServeLog

func SpanIDForServeLog(procNum int) logstore.SpanID

Types

type Cmd added in v0.18.12

type Cmd = v1alpha1.Cmd

type CmdCreateAction added in v0.18.12

type CmdCreateAction struct {
	Cmd *Cmd
}

func NewCmdCreateAction added in v0.18.12

func NewCmdCreateAction(cmd *Cmd) CmdCreateAction

func (CmdCreateAction) Action added in v0.18.12

func (CmdCreateAction) Action()

type CmdSpec added in v0.18.12

type CmdSpec = v1alpha1.CmdSpec

type CmdStateRunning added in v0.18.12

type CmdStateRunning = v1alpha1.CmdStateRunning

type CmdStateTerminated added in v0.18.12

type CmdStateTerminated = v1alpha1.CmdStateTerminated

type CmdStatus added in v0.18.12

type CmdStatus = v1alpha1.CmdStatus

type CmdUpdateAction added in v0.18.12

type CmdUpdateAction struct {
	Cmd *Cmd
}

func NewCmdUpdateAction added in v0.18.12

func NewCmdUpdateAction(cmd *Cmd) CmdUpdateAction

func (CmdUpdateAction) Action added in v0.18.12

func (CmdUpdateAction) Action()

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(execer Execer, proberManager ProberManager) *Controller

func (*Controller) OnChange

func (c *Controller) OnChange(ctx context.Context, st store.RStore, _ store.ChangeSummary)

func (*Controller) TearDown

func (c *Controller) TearDown(ctx context.Context)

type Execer

type Execer interface {
	Start(ctx context.Context, cmd model.Cmd, w io.Writer, statusCh chan statusAndMetadata, spanID model.LogSpanID) chan struct{}
}

func ProvideExecer

func ProvideExecer() Execer

type FakeExecer

type FakeExecer struct {
	// contains filtered or unexported fields
}

func NewFakeExecer

func NewFakeExecer() *FakeExecer

func (*FakeExecer) RequireNoKnownProcess

func (fe *FakeExecer) RequireNoKnownProcess(t *testing.T, cmd string)

func (*FakeExecer) Start

func (e *FakeExecer) Start(ctx context.Context, cmd model.Cmd, w io.Writer, statusCh chan statusAndMetadata, spanID model.LogSpanID) chan struct{}

type FakeProberManager added in v0.18.6

type FakeProberManager struct {
	// contains filtered or unexported fields
}

func NewFakeProberManager added in v0.18.6

func NewFakeProberManager() *FakeProberManager

func (*FakeProberManager) Exec added in v0.18.6

func (m *FakeProberManager) Exec(name string, args ...string) prober.ProberFunc

func (*FakeProberManager) HTTPGet added in v0.18.6

func (m *FakeProberManager) HTTPGet(u *url.URL, headers http.Header) prober.ProberFunc

func (*FakeProberManager) ProbeCount added in v0.18.6

func (m *FakeProberManager) ProbeCount() int

func (*FakeProberManager) TCPSocket added in v0.18.6

func (m *FakeProberManager) TCPSocket(host string, port int) prober.ProberFunc

type ObjectMeta added in v0.18.12

type ObjectMeta = metav1.ObjectMeta

type ProberManager added in v0.18.6

type ProberManager interface {
	HTTPGet(u *url.URL, headers http.Header) prober.ProberFunc
	TCPSocket(host string, port int) prober.ProberFunc
	Exec(name string, args ...string) prober.ProberFunc
}

func ProvideProberManager added in v0.18.6

func ProvideProberManager() ProberManager

type ServeSpec

type ServeSpec struct {
	ManifestName   model.ManifestName
	ServeCmd       model.Cmd
	TriggerTime    time.Time // TriggerTime is how Runner knows to restart; if it's newer than the TriggerTime of the currently running command, then Runner should restart it
	ReadinessProbe *v1alpha1.Probe
}

ServeSpec describes what Runner should be running

Jump to

Keyboard shortcuts

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