sync

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterPipelineRunByState added in v0.29.0

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 added in v0.29.0

func PrKey(run *tektonv1.PipelineRun) string

func RepoKey added in v0.29.0

func RepoKey(repo *v1alpha1.Repository) string

Types

type QueueManager

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

func NewQueueManager

func NewQueueManager(logger *zap.SugaredLogger) *QueueManager

func (*QueueManager) AddListToRunningQueue added in v0.28.1

func (qm *QueueManager) 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 (*QueueManager) AddToPendingQueue added in v0.28.1

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

func (*QueueManager) InitQueues

func (qm *QueueManager) 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 (*QueueManager) QueuedPipelineRuns added in v0.13.0

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

func (*QueueManager) RemoveAndTakeItemFromQueue added in v0.29.0

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

func (*QueueManager) RemoveFromQueue

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

func (*QueueManager) RemoveRepository added in v0.12.0

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

func (*QueueManager) RunningPipelineRuns added in v0.13.0

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

type QueueManagerInterface added in v0.29.0

type QueueManagerInterface 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