jobs

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2018 License: Apache-2.0 Imports: 12 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

This section is empty.

Types

type ConfigAgent

type ConfigAgent interface {
	Config() *config.Config
}

type Job

type Job struct {
	Type        string            `json:"type"`
	Repo        string            `json:"repo"`
	Refs        string            `json:"refs"`
	BaseRef     string            `json:"base_ref"`
	BaseSHA     string            `json:"base_sha"`
	PullSHA     string            `json:"pull_sha"`
	Number      int               `json:"number"`
	Author      string            `json:"author"`
	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       kube.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(kc serviceClusterClient, plClients map[string]PodLogClient, ca ConfigAgent) *JobAgent

NewJobAgent is a JobAgent constructor

func (*JobAgent) GetJobLog

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

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

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() []kube.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 PodLogClient

type PodLogClient interface {
	GetContainerLog(pod, container string) ([]byte, error)
}

Jump to

Keyboard shortcuts

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