tasklog

package
Version: v0.5.28 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	HostName      string `json:"hostname"`
	PodName       string `json:"podName"`
	Namespace     string `json:"namespace"`
	ContainerName string `json:"containerName"`
	ContainerID   string `json:"containerId"`
	LogName       string `json:"logName"`
}

Input contains all available information about task's execution that a log plugin can use to construct task's log links.

type Output

type Output struct {
	TaskLogs []*core.TaskLog `json:"taskLogs"`
}

Output contains all task logs a plugin generates for a given Input.

type Plugin

type Plugin interface {
	// Generates a TaskLog object given necessary computation information
	GetTaskLogs(input Input) (logs Output, err error)
}

Plugin represents an interface for task log plugins to implement to plug generated task log links into task events.

type TemplateLogPlugin

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

A simple log plugin that supports templates in urls to build the final log link. Supported templates are: {{ .podName }}: Gets the pod name as it shows in k8s dashboard, {{ .namespace }}: K8s namespace where the pod runs, {{ .containerName }}: The container name that generated the log, {{ .containerId }}: The container id docker/crio generated at run time, {{ .logName }}: A deployment specific name where to expect the logs to be. {{ .hostname }}: The hostname where the pod is running and where logs reside.

func NewTemplateLogPlugin

func NewTemplateLogPlugin(templateUris []string, messageFormat core.TaskLog_MessageFormat) TemplateLogPlugin

NewTemplateLogPlugin creates a template-based log plugin with the provided template Uri and message format. Supported templates are: {{ .podName }}: Gets the pod name as it shows in k8s dashboard, {{ .namespace }}: K8s namespace where the pod runs, {{ .containerName }}: The container name that generated the log, {{ .containerId }}: The container id docker/crio generated at run time, {{ .logName }}: A deployment specific name where to expect the logs to be. {{ .hostname }}: The hostname where the pod is running and where logs reside.

func (TemplateLogPlugin) GetTaskLog

func (s TemplateLogPlugin) GetTaskLog(podName, namespace, containerName, containerID, logName string) (core.TaskLog, error)

func (TemplateLogPlugin) GetTaskLogs

func (s TemplateLogPlugin) GetTaskLogs(input Input) (Output, error)

Jump to

Keyboard shortcuts

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