Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/logs/LogSnippetBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const LogSnippetBlock: React.FC<LogSnippetBlockProps> = ({
namespace={namespace}
podName={logDetails.podName}
title={logDetails.title}
staticMessage={logDetails.staticMessage}
>
{children}
</LogSnippetFromPod>
Expand Down
4 changes: 3 additions & 1 deletion src/components/logs/LogSnippetFromPod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type LogSnippetFromPodProps = {
namespace: string;
podName: string;
title: string;
staticMessage?: string;
};

const LogSnippetFromPod: React.FC<LogSnippetFromPodProps> = ({
Expand All @@ -20,6 +21,7 @@ const LogSnippetFromPod: React.FC<LogSnippetFromPodProps> = ({
namespace,
podName,
title,
staticMessage,
}) => {
const { t } = useTranslation('plugin__pipelines-console-plugin');

Expand Down Expand Up @@ -49,7 +51,7 @@ const LogSnippetFromPod: React.FC<LogSnippetFromPodProps> = ({
if (logError) {
return (
<Alert isInline title={title} variant="danger">
{logError}
{staticMessage ? staticMessage : logError}
</Alert>
);
}
Expand Down
1 change: 1 addition & 0 deletions src/components/logs/log-snippet-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ export const taskRunSnippetMessage = (
title: t('Failure on task {{taskName}} - check logs for details.', {
taskName,
}),
staticMessage: joinConditions(taskRunStatus.conditions),
};
};
6 changes: 5 additions & 1 deletion src/components/pipelines-tasks/taskRunLogSnippet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export const getTRLogSnippet = (taskRun: TaskRunKind): CombinedErrorDetails => {
}
const isKnownReason = (reason: string): boolean => {
// known reasons https://tekton.dev/vault/pipelines-v0.21.0/taskruns/#monitoring-execution-status
return ['TaskRunCancelled', 'TaskRunTimeout'].includes(reason);
return [
'TaskRunCancelled',
'TaskRunTimeout',
'TaskRunImagePullFailed',
].includes(reason);
};

if (isKnownReason(succeededCondition?.reason)) {
Expand Down
1 change: 1 addition & 0 deletions src/types/log-snippet-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ type ErrorDetails = {
export type ErrorDetailsWithLogName = ErrorDetails & {
containerName: string;
podName: string;
staticMessage?: string;
};
export type ErrorDetailsWithStaticLog = ErrorDetails & {
staticMessage: string;
Expand Down
Loading