strategy

package
v0.0.0-...-1738bad Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Failover

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

Failover is a scheduling strategy that handles clusters known to be in a faulty state. It holds a list of mapping from a broken cluster to an healthy one. This strategy get the cluster from a ProwJob and replaces it with another one if it was found on the mapping list.

func NewFailover

func NewFailover(cfg config.FailoverScheduling) *Failover

func (*Failover) Schedule

func (f *Failover) Schedule(_ context.Context, pj *prowv1.ProwJob) (Result, error)

type Interface

type Interface interface {
	Schedule(context.Context, *prowv1.ProwJob) (Result, error)
}

Interface is an interface over scheduling strategies

func Get

func Get(cfg *config.Config) Interface

Get gets a scheduling strategy in accordance to configuration. It defaults to Passthrough stategy if none has been configured.

type Passthrough

type Passthrough struct {
}

Passthrough is the backward compatible, transparent scheduling strategy, and in fact it pretends a scheduler didn't exist at all. This strategy assumes a cluster has been assigned to a ProwJob at the time it was defined.

func (*Passthrough) Schedule

func (p *Passthrough) Schedule(_ context.Context, pj *prowv1.ProwJob) (Result, error)

type Result

type Result struct {
	// A candidate cluster, the chosen one
	Cluster string
}

Result is an answer that came out of a scheduling strategy

Jump to

Keyboard shortcuts

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