Back to godoc.org
github.com/jenkins-x/jx/pkg/logs

package logs

v1.3.981 (5ccee8e)
Latest Go to latest
Published: Jun 25, 2020 | License: Apache-2.0 | Module: github.com/jenkins-x/jx

Index

func NewBucketProviderFromTeamSettingsConfiguration

func NewBucketProviderFromTeamSettingsConfiguration(jxClient versioned.Interface, ns string) (buckets.Provider, error)

type LogLine

type LogLine struct {
	Line       string
	ShouldMask bool
}

LogLine is the object sent to and received from the channels in the StreamLog and WriteLog functions defined by LogWriter

type LogWriter

type LogWriter interface {
	WriteLog(line LogLine, lch chan<- LogLine) error
	StreamLog(lch <-chan LogLine, ech <-chan error) error
	BytesLimit() int
}

LogWriter is an interface that can be implemented to define different ways to stream / write logs it's the implementer's responsibility to route those logs through the corresponding medium

type TektonLogger

type TektonLogger struct {
	JXClient          versioned.Interface
	TektonClient      tektonclient.Interface
	KubeClient        kubernetes.Interface
	LogWriter         LogWriter
	Namespace         string
	LogsRetrieverFunc retrieverFunc

	FailIfPodFails bool
	// contains filtered or unexported fields
}

TektonLogger contains the necessary clients and the namespace to get data from the cluster, an implementation of LogWriter to write logs to and a logs retriever function to override the default way to obtain logs

func (TektonLogger) GetRunningBuildLogs

func (t TektonLogger) GetRunningBuildLogs(pa *v1.PipelineActivity, buildName string, noWaitForRuns bool) error

GetRunningBuildLogs obtains the logs of the provided PipelineActivity and streams the running build pods' logs using the provided LogWriter

func (TektonLogger) GetTektonPipelinesWithActivePipelineActivity

func (t TektonLogger) GetTektonPipelinesWithActivePipelineActivity(filters []string) ([]string, map[string]*v1.PipelineActivity, error)

GetTektonPipelinesWithActivePipelineActivity returns list of all PipelineActivities with corresponding Tekton PipelineRuns ordered by the PipelineRun creation timestamp and a map to obtain its reference once a name has been selected

func (*TektonLogger) StreamPipelinePersistentLogs

func (t *TektonLogger) StreamPipelinePersistentLogs(logsURL string, jxClient versioned.Interface, ns string, authSvc auth.ConfigService) error

StreamPipelinePersistentLogs reads logs from the provided bucket URL and writes them using the provided LogWriter

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier