Skip to content

Commit

Permalink
Set ShowWhilePending on templated log links
Browse files Browse the repository at this point in the history
  • Loading branch information
fg91 committed Jan 14, 2024
1 parent 1fa91aa commit a08bd5b
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions flyteplugins/go/tasks/pluginmachinery/tasklog/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ func (input Input) templateVarsForScheme(scheme TemplateScheme) TemplateVars {
TemplateVar{defaultRegexes.ContainerName, input.ContainerName},
TemplateVar{defaultRegexes.ContainerID, containerID},
TemplateVar{defaultRegexes.Hostname, input.HostName},
TemplateVar{defaultRegexes.PodRFC3339StartTime, input.PodRFC3339StartTime},
TemplateVar{defaultRegexes.PodRFC3339FinishTime, input.PodRFC3339FinishTime},
TemplateVar{
defaultRegexes.PodUnixStartTime,
strconv.FormatInt(input.PodUnixStartTime, 10),
},
TemplateVar{
defaultRegexes.PodUnixFinishTime,
strconv.FormatInt(input.PodUnixFinishTime, 10),
},
)
if gotExtraTemplateVars {
vars = append(vars, input.ExtraTemplateVarsByScheme.Pod...)
Expand Down Expand Up @@ -177,20 +187,6 @@ func (input Input) templateVarsForScheme(scheme TemplateScheme) TemplateVars {
}
}

vars = append(
vars,
TemplateVar{defaultRegexes.PodRFC3339StartTime, input.PodRFC3339StartTime},
TemplateVar{defaultRegexes.PodRFC3339FinishTime, input.PodRFC3339FinishTime},
TemplateVar{
defaultRegexes.PodUnixStartTime,
strconv.FormatInt(input.PodUnixStartTime, 10),
},
TemplateVar{
defaultRegexes.PodUnixFinishTime,
strconv.FormatInt(input.PodUnixFinishTime, 10),
},
)

return vars
}

Expand All @@ -214,9 +210,10 @@ func (p TemplateLogPlugin) GetTaskLogs(input Input) (Output, error) {
continue
}
taskLogs = append(taskLogs, &core.TaskLog{
Uri: replaceAll(templateURI, templateVars),
Name: p.DisplayName + input.LogName,
MessageFormat: p.MessageFormat,
Uri: replaceAll(templateURI, templateVars),
Name: p.DisplayName + input.LogName,
MessageFormat: p.MessageFormat,
ShowWhilePending: p.ShowWhilePending,
})
}

Expand Down

0 comments on commit a08bd5b

Please sign in to comment.