cmd

package
v0.18.12 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: Apache-2.0 Imports: 29 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")
View Source
var WireSet = wire.NewSet(
	NewController,
)

Functions

func NewProcessExecer

func NewProcessExecer() *processExecer

func SpanIDForServeLog

func SpanIDForServeLog(procNum int) logstore.SpanID

Types

type Cmd

type Cmd = v1alpha1.Cmd

type Controller

type Controller struct {
	client.Client
}

func NewController

func NewController() *Controller

func (*Controller) Reconcile

func (r *Controller) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*Controller) SetClient

func (r *Controller) SetClient(client client.Client)

func (*Controller) SetupWithManager

func (r *Controller) SetupWithManager(mgr ctrl.Manager) error

type ControllerOld

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

func NewControllerOld

func NewControllerOld(execer Execer, proberManager ProberManager) *ControllerOld

func (*ControllerOld) OnChange

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

func (*ControllerOld) TearDown

func (c *ControllerOld) 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

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

func NewFakeProberManager

func NewFakeProberManager() *FakeProberManager

func (*FakeProberManager) Exec

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

func (*FakeProberManager) HTTPGet

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

func (*FakeProberManager) ProbeCount

func (m *FakeProberManager) ProbeCount() int

func (*FakeProberManager) TCPSocket

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

type LocalServeLogActionWriter

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

func (LocalServeLogActionWriter) Write

func (w LocalServeLogActionWriter) Write(level logger.Level, fields logger.Fields, p []byte) error

type LocalServeReadinessProbeAction

type LocalServeReadinessProbeAction struct {
	ManifestName model.ManifestName
	Ready        bool
}

func (LocalServeReadinessProbeAction) Action

type LocalServeStatusAction

type LocalServeStatusAction struct {
	ManifestName model.ManifestName
	Status       model.RuntimeStatus
	PID          int // 0 if there's no process running
	SpanID       model.LogSpanID
}

func (LocalServeStatusAction) Action

func (LocalServeStatusAction) Action()

type ProberManager

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

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