genericpilot

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2018 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrExecHook          = "ErrExecHook"
	ReasonProcessStarted = "ProcessStarted"
	ReasonPhaseComplete  = "ExecHook"

	MessageErrExecHook    = "Error executing hook: %s"
	MessageProcessStarted = "Subprocess %q started"
	MessagePhaseComplete  = "Completed phase %q"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericPilot

type GenericPilot struct {
	Options Options
	// contains filtered or unexported fields
}

func (*GenericPilot) Elector

func (g *GenericPilot) Elector() leaderelection.Interface

func (*GenericPilot) IsRunning

func (g *GenericPilot) IsRunning() bool

func (*GenericPilot) IsThisPilot

func (g *GenericPilot) IsThisPilot(pilot *v1alpha1.Pilot) bool

IsThisPilot will return true if 'pilot' corresponds to the Pilot resource for this pilot.

func (*GenericPilot) Run

func (g *GenericPilot) Run() error

type Options

type Options struct {
	// KubernetesClient is the kubernetes clientset used to talk to the
	// apiserver
	KubernetesClient kubernetes.Interface
	// NavigatorClient is the clientset used to talk to the navigator apiserver
	NavigatorClient clientset.Interface
	// SharedInformerFactory provides a shared cache of informers
	SharedInformerFactory informers.SharedInformerFactory

	// PilotName is the name of this Pilot
	PilotName string
	// PilotNamespace is the namespace the corresponding Pilot exists within
	PilotNamespace          string
	LeaderElectionConfigMap string

	// CmdFunc returns an *exec.Cmd for a given Pilot resource for the pilot
	CmdFunc func(*v1alpha1.Pilot) (*exec.Cmd, error)
	// Signals contains a genericpilot->os.Signal translation
	Signals processmanager.Signals
	// Stdout to be used when creating the application process
	Stdout *os.File
	// Stderr to be used when creating the application process
	Stderr *os.File
	// StopCh signals that the Pilot should shut down when closed
	StopCh <-chan struct{}

	// Hooks to be run during the lifecycle of the application
	Hooks          *hook.Hooks
	ReadinessProbe probe.Check
	LivenessProbe  probe.Check

	SyncFunc              func(*v1alpha1.Pilot) error
	LeaderElectedSyncFunc func(*v1alpha1.Pilot) error
}

func NewDefaultOptions

func NewDefaultOptions() *Options

func (*Options) AddFlags

func (o *Options) AddFlags(flags *pflag.FlagSet)

func (*Options) Complete

func (o *Options) Complete() error

func (*Options) Pilot

func (o *Options) Pilot() (*GenericPilot, error)

func (*Options) Validate

func (o *Options) Validate() []error

Directories

Path Synopsis
package hook is used to ensure execution of a set of pre-start, post-start, pre-stop and post-stop hooks.
package hook is used to ensure execution of a set of pre-start, post-start, pre-stop and post-stop hooks.

Jump to

Keyboard shortcuts

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