 Documentation
      ¶
      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"`
	PodUnixStartTime  int64  `json:"podUnixStartTime"`
	PodUnixFinishTime int64  `json:"podUnixFinishTime"`
	PodUID            string `json:"podUID"`
}
    Input contains all available information about task's execution that a log plugin can use to construct task's log links.
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, {{ .podUID }}: Gets the pod UID, {{ .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. {{ .podUnixStartTime }}: The pod creation time (in unix seconds, not millis) {{ .podUnixFinishTime }}: Don't have a good mechanism for this yet, but approximating with time.Now for now
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, {{ .podUID }}: Gets the pod UID, {{ .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. {{ .podUnixStartTime }}: The pod creation time (in unix seconds, not millis) {{ .podUnixFinishTime }}: Don't have a good mechanism for this yet, but approximating with time.Now for now
func (TemplateLogPlugin) GetTaskLog ¶
func (TemplateLogPlugin) GetTaskLogs ¶
func (s TemplateLogPlugin) GetTaskLogs(input Input) (Output, error)