lifecycle

package
v0.0.0-...-f294607 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCoolOff

func GetCoolOff(ctx context.Context) time.Duration

func SetCoolOff

func SetCoolOff(ctx context.Context, coolOff time.Duration) context.Context

func WorkloadKindFrombject

func WorkloadKindFrombject(obj metav1.Object) k8sconsts.WorkloadKind

Types

type BaseTransition

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

type InstrumentationEnded

type InstrumentationEnded struct {
	BaseTransition
}

func (*InstrumentationEnded) Execute

func (i *InstrumentationEnded) Execute(ctx context.Context, obj metav1.Object) error

func (*InstrumentationEnded) From

func (i *InstrumentationEnded) From() State

func (*InstrumentationEnded) GetTransitionState

func (i *InstrumentationEnded) GetTransitionState(ctx context.Context, obj metav1.Object) (State, error)

func (*InstrumentationEnded) To

func (i *InstrumentationEnded) To() State

type InstrumentationStarted

type InstrumentationStarted struct {
	BaseTransition
}

func (*InstrumentationStarted) Execute

func (*InstrumentationStarted) From

func (i *InstrumentationStarted) From() State

func (*InstrumentationStarted) GetTransitionState

func (i *InstrumentationStarted) GetTransitionState(ctx context.Context, obj metav1.Object) (State, error)

func (*InstrumentationStarted) To

func (i *InstrumentationStarted) To() State

type Orchestrator

type Orchestrator struct {
	Client          *kube.Client
	OdigosNamespace string
	TransitionsMap  map[State]Transition
	Remote          bool
}

func NewOrchestrator

func NewOrchestrator(client *kube.Client, ctx context.Context, isRemote bool) (*Orchestrator, error)

func (*Orchestrator) Apply

func (o *Orchestrator) Apply(ctx context.Context, obj metav1.Object) error

Apply is called sequentially on workloads to instrument them.

type PostCheck

type PostCheck struct {
	BaseTransition
}

func (*PostCheck) Execute

func (i *PostCheck) Execute(ctx context.Context, obj metav1.Object) error

func (*PostCheck) From

func (i *PostCheck) From() State

func (*PostCheck) GetTransitionState

func (i *PostCheck) GetTransitionState(ctx context.Context, obj metav1.Object) (State, error)

func (*PostCheck) To

func (i *PostCheck) To() State

type PreflightCheck

type PreflightCheck struct {
	BaseTransition
}

func (*PreflightCheck) Execute

func (p *PreflightCheck) Execute(ctx context.Context, obj metav1.Object) error

func (*PreflightCheck) From

func (p *PreflightCheck) From() State

func (*PreflightCheck) GetTransitionState

func (p *PreflightCheck) GetTransitionState(ctx context.Context, obj metav1.Object) (State, error)

func (*PreflightCheck) To

func (p *PreflightCheck) To() State

type RequestLangDetection

type RequestLangDetection struct {
	BaseTransition
}

func (*RequestLangDetection) Execute

func (r *RequestLangDetection) Execute(ctx context.Context, obj metav1.Object) error

func (*RequestLangDetection) From

func (r *RequestLangDetection) From() State

func (*RequestLangDetection) GetTransitionState

func (r *RequestLangDetection) GetTransitionState(ctx context.Context, obj metav1.Object) (State, error)

func (*RequestLangDetection) To

func (r *RequestLangDetection) To() State

type State

type State int
const (
	// Unknown is an error state.
	StateUnknown State = iota

	// NoSourceCreated is the initial state before instrumentation starts.
	StateNoSourceCreated

	// PreflightChecksPassed indicates the workload is healthy and can be instrumented.
	StatePreflightChecksPassed

	// SourceCreated indicates the Source object has been created for the workload and language detection is in progress.
	StateSourceCreated

	// LangDetected indicates the language detection has completed and the workload is eligible for instrumentation.
	StateLangDetected

	// InstrumentationInProgress indicates the instrumentation is in progress, but the pods are not yet running.
	StateInstrumentationInProgress

	// Instrumented indicates the instrumentation has completed and the workload is instrumented.
	StateInstrumented

	// PostCheckPassed indicates all pods in the workload are healthy and the post check has completed and the workload is ready for use.
	StatePostCheckPassed
)

func (State) String

func (s State) String() string

type Transition

type Transition interface {
	From() State
	To() State
	Execute(ctx context.Context, obj metav1.Object) error
	GetTransitionState(ctx context.Context, obj metav1.Object) (State, error)
}

type WaitForLangDetection

type WaitForLangDetection struct {
	BaseTransition
}

func (*WaitForLangDetection) Execute

func (w *WaitForLangDetection) Execute(ctx context.Context, obj metav1.Object) error

func (*WaitForLangDetection) From

func (w *WaitForLangDetection) From() State

func (*WaitForLangDetection) GetTransitionState

func (w *WaitForLangDetection) GetTransitionState(ctx context.Context, obj metav1.Object) (State, error)

func (*WaitForLangDetection) To

func (w *WaitForLangDetection) To() State

Jump to

Keyboard shortcuts

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