worker

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoUnleasedPods = errors.New("no unleased pods found")
)

Functions

func NewRequestQueue

func NewRequestQueue() *requestQueue

Types

type Options

type Options struct {
	Log                 logr.Logger
	MaxIdleTime         time.Duration
	SyncWaitTime        time.Duration
	WatchTimeoutSeconds int64
}

type PodRequest added in v0.1.4

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

type PodRequestResult

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

type Pool

type Pool interface {
	Get(ctx context.Context, owner string) (workerAddr string, err error)
	Release(ctx context.Context, workerAddr string) error
	Close()
}

func NewPool

func NewPool(ctx context.Context, clientset kubernetes.Interface, conf config.Buildkit, opts ...PoolOption) Pool

NewPool creates a new worker pool that can be used to lease buildkit workers for image builds.

type PoolOption

type PoolOption func(o Options) Options

func Logger

func Logger(log logr.Logger) PoolOption

func MaxIdleTime

func MaxIdleTime(d time.Duration) PoolOption

func SyncWaitTime

func SyncWaitTime(d time.Duration) PoolOption

func WatchTimeoutSeconds

func WatchTimeoutSeconds(s int64) PoolOption

type RequestQueue

type RequestQueue interface {
	Enqueue(*PodRequest)
	Dequeue() *PodRequest
	Len() int
	Remove(*PodRequest) bool
}

Jump to

Keyboard shortcuts

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