cmd

package
v0.30.1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 44 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(localEnv *localexec.Env) *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 ConfigMap added in v0.22.10

type ConfigMap = v1alpha1.ConfigMap

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, clock clockwork.Clock, scheme *runtime.Scheme) *Controller

func (*Controller) CreateBuilder added in v0.20.9

func (r *Controller) CreateBuilder(mgr ctrl.Manager) (*builder.Builder, error)

func (*Controller) ForceRun added in v0.21.1

func (c *Controller) ForceRun(ctx context.Context, cmd *v1alpha1.Cmd) (*v1alpha1.CmdStatus, error)

Forces the command to run now.

This is a hack to get local_resource commands into the API server, even though the API server doesn't have a notion of resource deps yet.

Blocks until the command is finished, then returns its status.

func (*Controller) Reconcile

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

func (*Controller) TearDown added in v0.19.0

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

type Execer

type Execer interface {
	// Returns a channel to pull status updates from. After the process exists
	// (and transmits its final status), the channel is closed.
	Start(ctx context.Context, cmd model.Cmd, w io.Writer) chan statusAndMetadata
}

func ProvideExecer

func ProvideExecer(localEnv *localexec.Env) 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) chan statusAndMetadata

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

type RestartOnSpec = v1alpha1.RestartOnSpec

type StartOnSpec added in v0.20.8

type StartOnSpec = v1alpha1.StartOnSpec

type UIButton added in v0.20.8

type UIButton = v1alpha1.UIButton

type UIButtonSpec added in v0.20.8

type UIButtonSpec = v1alpha1.UIButtonSpec

Jump to

Keyboard shortcuts

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