jobs

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Overview

Package jobs implements methods on job information used by Prow component deck

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrProwJobNotFound

func IsErrProwJobNotFound(err error) bool

Types

type Job

type Job struct {
	Type        string               `json:"type"`
	Refs        prowapi.Refs         `json:"refs"`
	RefsKey     string               `json:"refs_key"`
	Job         string               `json:"job"`
	BuildID     string               `json:"build_id"`
	Context     string               `json:"context"`
	Started     string               `json:"started"`
	Finished    string               `json:"finished"`
	Duration    string               `json:"duration"`
	State       string               `json:"state"`
	Description string               `json:"description"`
	URL         string               `json:"url"`
	PodName     string               `json:"pod_name"`
	Agent       prowapi.ProwJobAgent `json:"agent"`
	ProwJob     string               `json:"prow_job"`
	// contains filtered or unexported fields
}

Job holds information about a job prow is running/has run. TODO(#5216): Remove this, and all associated machinery.

type JobAgent

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

JobAgent creates lists of jobs, updates their status and returns their run logs.

func NewJobAgent

func NewJobAgent(ctx context.Context, pjLister PJListingClient, hiddenOnly, showHidden bool, tenantIDs []string, plClients map[string]PodLogClient, cfg config.Getter) *JobAgent

NewJobAgent is a JobAgent constructor.

func (*JobAgent) GetJobLog

func (ja *JobAgent) GetJobLog(job, id string, container string) ([]byte, error)

GetJobLog returns the job logs, works for both kubernetes and jenkins agent types.

func (*JobAgent) GetProwJob

func (ja *JobAgent) GetProwJob(job, id string) (prowapi.ProwJob, error)

GetProwJob finds the corresponding Prowjob resource from the provided job name and build ID

func (*JobAgent) Jobs

func (ja *JobAgent) Jobs() []Job

Jobs returns a thread-safe snapshot of the current job state.

func (*JobAgent) ProwJobs

func (ja *JobAgent) ProwJobs() []prowapi.ProwJob

ProwJobs returns a thread-safe snapshot of the current prow jobs.

func (*JobAgent) Start

func (ja *JobAgent) Start()

Start will start the job and periodically update it.

type PJListingClient

type PJListingClient interface {
	List(context.Context, *prowapi.ProwJobList, ...ctrlruntimeclient.ListOption) error
}

PJListingClient is an interface to list ProwJobs

type PodLogClient

type PodLogClient interface {
	GetLogs(name, container string) ([]byte, error)
}

PodLogClient is an interface for interacting with the pod logs.

Jump to

Keyboard shortcuts

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