cmd

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: Apache-2.0 Imports: 35 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 NewProcessExecer

func NewProcessExecer() *processExecer

Types

type Cmd

type Cmd = v1alpha1.Cmd

type CmdList added in v0.19.0

type CmdList = v1alpha1.CmdList

type CmdSpec added in v0.19.0

type CmdSpec = v1alpha1.CmdSpec

type CmdStateRunning added in v0.19.0

type CmdStateRunning = v1alpha1.CmdStateRunning

type CmdStateTerminated added in v0.19.0

type CmdStateTerminated = v1alpha1.CmdStateTerminated

type CmdStateWaiting added in v0.19.0

type CmdStateWaiting = v1alpha1.CmdStateWaiting

type CmdStatus added in v0.19.0

type CmdStatus = v1alpha1.CmdStatus

type Controller

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

A controller that reads CmdSpec and writes CmdStatus

func NewController

func NewController(ctx context.Context, execer Execer, proberManager ProberManager, client ctrlclient.Client, st store.RStore) *Controller

func (*Controller) Reconcile

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

func (*Controller) SetClient

func (c *Controller) SetClient(client ctrlclient.Client)

func (*Controller) SetupWithManager

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

func (*Controller) TearDown added in v0.19.0

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

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 FileWatch added in v0.19.0

type FileWatch = v1alpha1.FileWatch

type FileWatchSpec added in v0.19.0

type FileWatchSpec = v1alpha1.FileWatchSpec

type ObjectMeta added in v0.19.0

type ObjectMeta = metav1.ObjectMeta

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 RestartManager added in v0.19.0

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

Helper struct to help reconcilers determine when to restart their objects when a file changes.

TODO(nick): Currently this uses *Cmd types, but it could be generalized to any type with a *RestartOn field.

func NewRestartManager added in v0.19.0

func NewRestartManager(client client.Client) *RestartManager

type RestartOnSpec added in v0.19.0

type RestartOnSpec = v1alpha1.RestartOnSpec

Jump to

Keyboard shortcuts

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