Help us shape the future of Go! Take the 2026 Go Developer Survey

queue

package
v0.48.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterPipelineRunByState

func FilterPipelineRunByState(ctx context.Context, tekton versioned2.Interface, orderList []string, wantedStatus, wantedState string) []string

FilterPipelineRunByInProgress filters the given list of PipelineRun names to only include those that are in a "queued" state and have a pending status. It retrieves the PipelineRun objects from the Tekton API and checks their annotations and status to determine if they should be included.

Returns A list of PipelineRun names that are in a "queued" state and have a pending status.

func PrKey

func PrKey(run *tektonv1.PipelineRun) string

func RepoKey

func RepoKey(repo *v1alpha1.Repository) string

Types

type Manager

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

func NewManager

func NewManager(logger *zap.SugaredLogger) *Manager

func (*Manager) AddListToRunningQueue

func (qm *Manager) AddListToRunningQueue(repo *v1alpha1.Repository, list []string) ([]string, error)

AddListToRunningQueue adds the pipelineRun to the waiting queue of the repository and if it is at the top and ready to run which means currently running pipelineRun < limit then move it to running queue This adds the pipelineRuns in the same order as in the list.

func (*Manager) AddToPendingQueue

func (qm *Manager) AddToPendingQueue(repo *v1alpha1.Repository, list []string) error

func (*Manager) InitQueues

func (qm *Manager) InitQueues(ctx context.Context, tekton versioned2.Interface, pac versioned.Interface) error

InitQueues rebuild all the queues for all repository if concurrency is defined before reconciler started reconciling them.

func (*Manager) QueuedPipelineRuns

func (qm *Manager) QueuedPipelineRuns(repo *v1alpha1.Repository) []string

func (*Manager) RemoveAndTakeItemFromQueue

func (qm *Manager) RemoveAndTakeItemFromQueue(repo *v1alpha1.Repository, run *tektonv1.PipelineRun) string

func (*Manager) RemoveFromQueue

func (qm *Manager) RemoveFromQueue(repoKey, prKey string) bool

func (*Manager) RemoveRepository

func (qm *Manager) RemoveRepository(repo *v1alpha1.Repository)

func (*Manager) RunningPipelineRuns

func (qm *Manager) RunningPipelineRuns(repo *v1alpha1.Repository) []string

type ManagerInterface

type ManagerInterface interface {
	InitQueues(ctx context.Context, tekton tektonVersionedClient.Interface, pac versioned.Interface) error
	RemoveRepository(repo *v1alpha1.Repository)
	QueuedPipelineRuns(repo *v1alpha1.Repository) []string
	RunningPipelineRuns(repo *v1alpha1.Repository) []string
	AddListToRunningQueue(repo *v1alpha1.Repository, list []string) ([]string, error)
	AddToPendingQueue(repo *v1alpha1.Repository, list []string) error
	RemoveFromQueue(repoKey, prKey string) bool
	RemoveAndTakeItemFromQueue(repo *v1alpha1.Repository, run *tektonv1.PipelineRun) string
}

type Semaphore

type Semaphore interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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