state

package
v1.7.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// SyncJob will create or delete Pods according to Job's spec.
	SyncJob ActionFn
	// KillJob kill all Pods of Job with phase not in podRetainPhase.
	KillJob KillActionFn
)
View Source
var PodRetainPhaseNone = PhaseMap{}

PodRetainPhaseNone stores no phase.

View Source
var PodRetainPhaseSoft = PhaseMap{
	v1.PodSucceeded: {},
	v1.PodFailed:    {},
}

PodRetainPhaseSoft stores PodSucceeded and PodFailed Phase.

Functions

func TotalTaskMinAvailable added in v1.3.0

func TotalTaskMinAvailable(job *vcbatch.Job) int32

TotalTaskMinAvailable returns the sum of task minAvailable

func TotalTasks

func TotalTasks(job *vcbatch.Job) int32

TotalTasks returns number of tasks in a given volcano job.

Types

type ActionFn

type ActionFn func(job *apis.JobInfo, fn UpdateStatusFn) error

ActionFn will create or delete Pods according to Job's spec.

type KillActionFn

type KillActionFn func(job *apis.JobInfo, podRetainPhase PhaseMap, fn UpdateStatusFn) error

KillActionFn kill all Pods of Job with phase not in podRetainPhase.

type PhaseMap

type PhaseMap map[v1.PodPhase]struct{}

PhaseMap to store the pod phases.

type State

type State interface {
	// Execute executes the actions based on current state.
	Execute(act v1alpha1.Action) error
}

State interface.

func NewState

func NewState(jobInfo *apis.JobInfo) State

NewState gets the state from the volcano job Phase.

type UpdateStatusFn

type UpdateStatusFn func(status *vcbatch.JobStatus) (jobPhaseChanged bool)

UpdateStatusFn updates the job status.

Jump to

Keyboard shortcuts

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