|
14 | 14 | let { data }: PageProps = $props();
|
15 | 15 | let { TeamOverview, teamSlug, viewerIsMember } = $derived(data);
|
16 | 16 |
|
17 |
| - const deprecatedImages = $derived( |
| 17 | + const getErrors = (errorType: string) => |
18 | 18 | $TeamOverview.data?.team.workloads.nodes.filter((workload) =>
|
19 |
| - workload.status.errors.some( |
20 |
| - (error) => error.__typename === 'WorkloadStatusDeprecatedRegistry' |
21 |
| - ) |
22 |
| - ) |
23 |
| - ); |
24 |
| -
|
25 |
| - const syncFailed = $derived( |
26 |
| - $TeamOverview.data?.team.workloads.nodes.filter((workload) => |
27 |
| - workload.status.errors.some( |
28 |
| - (error) => error.__typename === 'WorkloadStatusSynchronizationFailing' |
29 |
| - ) |
30 |
| - ) |
31 |
| - ); |
| 19 | + workload.status.errors.some((error) => error.__typename === errorType) |
| 20 | + ); |
32 | 21 | </script>
|
33 | 22 |
|
34 | 23 | {#if page.url.searchParams.has('deleted')}
|
|
39 | 28 | </Alert>
|
40 | 29 | {/if}
|
41 | 30 | <div class="alerts-wrapper">
|
42 |
| - {#if syncFailed?.length} |
| 31 | + {#if getErrors('WorkloadStatusInvalidNaisYaml')} |
| 32 | + {@const invalidYaml = getErrors('WorkloadStatusInvalidNaisYaml')!} |
| 33 | + <Alert variant="error"> |
| 34 | + <div style="display: flex; flex-direction: column; gap: var(--a-spacing-3)"> |
| 35 | + <Heading level="2" size="small">Rollout Failed - Invalid Manifest</Heading> |
| 36 | + <BodyShort> |
| 37 | + The rollout of the following workload{invalidYaml.length === 1 ? '' : 's'} failed because of |
| 38 | + {invalidYaml.length === 1 ? 'an' : ''} |
| 39 | + invalid manifest{invalidYaml.length === 1 ? '' : 's'}. |
| 40 | + </BodyShort> |
| 41 | + <div> |
| 42 | + {#each invalidYaml as workload (workload.id)} |
| 43 | + <WorkloadLink {workload} hideTeam /> |
| 44 | + {/each} |
| 45 | + </div> |
| 46 | + </div> |
| 47 | + </Alert> |
| 48 | + {/if} |
| 49 | + |
| 50 | + {#if getErrors('WorkloadStatusSynchronizationFailing')} |
| 51 | + {@const syncFailed = getErrors('WorkloadStatusSynchronizationFailing')!} |
43 | 52 | <Alert variant="error">
|
44 | 53 | <div style="display: flex; flex-direction: column; gap: var(--a-spacing-3)">
|
45 |
| - <Heading level="2" size="small">Synchronization failing</Heading> |
| 54 | + <Heading level="2" size="small">Rollout Failed - Synchronization Error</Heading> |
46 | 55 | <BodyShort>
|
47 | 56 | The rollout of the following workload{syncFailed.length === 1 ? '' : 's'} failed because of
|
48 | 57 | synchronization errors.
|
|
56 | 65 | </Alert>
|
57 | 66 | {/if}
|
58 | 67 |
|
59 |
| - {#if deprecatedImages?.length} |
| 68 | + {#if getErrors('WorkloadStatusDeprecatedRegistry')} |
| 69 | + {@const deprecatedImages = getErrors('WorkloadStatusDeprecatedRegistry')!} |
60 | 70 | <Alert variant="warning">
|
61 | 71 | Starting April 1st, applications and jobs on Nais must use images from Google Artifact
|
62 | 72 | Registry (GAR). The easiest way to ensure that images are stored in GAR is to use Nais' GitHub
|
|
0 commit comments