Documentation ¶
Index ¶
- Constants
- Variables
- func New(logger *zap.Logger, client kubernetes.Interface, cfg Config) *worker
- func NewImagePullBackOffWatcher(logger *zap.Logger, k8s kubernetes.Interface, cfg *config.Config) *imagePullBackOffWatcher
- func NewJobWrapper(logger *zap.Logger, job *api.CommandJob, config Config) *jobWrapper
- func NewPodCompletionWatcher(logger *zap.Logger, k8s kubernetes.Interface) *completionsWatcher
- func PatchPodSpec(original *corev1.PodSpec, patch *corev1.PodSpec) (*corev1.PodSpec, error)
- type Checkout
- type Config
- type KubernetesPlugin
- type MaxInFlightLimiter
- func (l *MaxInFlightLimiter) Create(ctx context.Context, job *api.CommandJob) error
- func (l *MaxInFlightLimiter) InFlight() int
- func (l *MaxInFlightLimiter) OnAdd(obj interface{}, isInInitialList bool)
- func (l *MaxInFlightLimiter) OnDelete(obj interface{})
- func (l *MaxInFlightLimiter) OnUpdate(_, obj interface{})
- func (l *MaxInFlightLimiter) RegisterInformer(ctx context.Context, factory informers.SharedInformerFactory) error
- type Metadata
Constants ¶
View Source
const (
AgentContainerName = "agent"
)
Variables ¶
View Source
var ErrNoCommandModification = errors.New("modifying container commands or args via podSpecPatch is not supported. Specify the command in the job's command field instead")
Functions ¶
func NewImagePullBackOffWatcher ¶
func NewImagePullBackOffWatcher( logger *zap.Logger, k8s kubernetes.Interface, cfg *config.Config, ) *imagePullBackOffWatcher
NewImagePullBackOffWatcher creates an informer that will use the Buildkite GraphQL API to cancel jobs that have pods with containers in the ImagePullBackOff state
func NewJobWrapper ¶
func NewJobWrapper(logger *zap.Logger, job *api.CommandJob, config Config) *jobWrapper
func NewPodCompletionWatcher ¶
func NewPodCompletionWatcher(logger *zap.Logger, k8s kubernetes.Interface) *completionsWatcher
Types ¶
type KubernetesPlugin ¶
type KubernetesPlugin struct { PodSpec *corev1.PodSpec `json:"podSpec,omitempty"` PodSpecPatch *corev1.PodSpec `json:"podSpecPatch,omitempty"` GitEnvFrom []corev1.EnvFromSource `json:"gitEnvFrom,omitempty"` Sidecars []corev1.Container `json:"sidecars,omitempty"` Metadata Metadata `json:"metadata,omitempty"` ExtraVolumeMounts []corev1.VolumeMount `json:"extraVolumeMounts,omitempty"` Checkout Checkout `json:"checkout,omitempty"` }
type MaxInFlightLimiter ¶
type MaxInFlightLimiter struct { MaxInFlight int // contains filtered or unexported fields }
func NewLimiter ¶
func NewLimiter( logger *zap.Logger, scheduler monitor.JobHandler, maxInFlight int, ) *MaxInFlightLimiter
func (*MaxInFlightLimiter) Create ¶
func (l *MaxInFlightLimiter) Create(ctx context.Context, job *api.CommandJob) error
func (*MaxInFlightLimiter) InFlight ¶
func (l *MaxInFlightLimiter) InFlight() int
func (*MaxInFlightLimiter) OnAdd ¶
func (l *MaxInFlightLimiter) OnAdd(obj interface{}, isInInitialList bool)
load jobs at controller startup/restart
func (*MaxInFlightLimiter) OnDelete ¶
func (l *MaxInFlightLimiter) OnDelete(obj interface{})
if jobs are deleted before they complete, ensure we remove them from inFlight
func (*MaxInFlightLimiter) OnUpdate ¶
func (l *MaxInFlightLimiter) OnUpdate(_, obj interface{})
if a job is still running, add it to inFlight, otherwise try to remove it
func (*MaxInFlightLimiter) RegisterInformer ¶
func (l *MaxInFlightLimiter) RegisterInformer( ctx context.Context, factory informers.SharedInformerFactory, ) error
Creates a Jobs informer, registers the handler on it, and waits for cache sync
Click to show internal directories.
Click to hide internal directories.