-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
17 changed files
with
474 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
<script lang="ts"> | ||
import { page } from '$app/stores'; | ||
import { PendingValue, fragment, graphql, type JobErrorFragment } from '$houdini'; | ||
import { Alert } from '@nais/ds-svelte-community'; | ||
import Loading from './Loading.svelte'; | ||
export let error: JobErrorFragment; | ||
$: data = fragment( | ||
error, | ||
graphql(` | ||
fragment JobErrorFragment on StateError { | ||
revision @loading | ||
type: __typename | ||
... on DeprecatedRegistryError { | ||
level | ||
name | ||
registry | ||
repository | ||
revision | ||
tag | ||
} | ||
... on InvalidNaisYamlError { | ||
level | ||
detail | ||
} | ||
... on InboundAccessError { | ||
level | ||
rule { | ||
application | ||
cluster | ||
mutual | ||
mutualExplanation | ||
namespace | ||
} | ||
} | ||
... on OutboundAccessError { | ||
level | ||
rule { | ||
application | ||
cluster | ||
mutual | ||
mutualExplanation | ||
namespace | ||
} | ||
} | ||
... on FailedRunError { | ||
level | ||
runMessage | ||
runName | ||
} | ||
} | ||
`) | ||
); | ||
$: team = $page.params.team; | ||
$: env = $page.params.env; | ||
$: job = $page.params.job; | ||
</script> | ||
|
||
<div class="wrapper"> | ||
{#if $data.revision == PendingValue} | ||
<Loading /> | ||
{:else if $data.__typename === 'DeprecatedRegistryError'} | ||
<Alert variant="warning"> | ||
Deprecated image registry <strong>{$data.registry}</strong> for image | ||
<strong>{$data.name}</strong>. See | ||
<a href="https://github.com/nais/docker-build-push"> docker-build-push</a> on how to migrate to | ||
Google Artifact Registry. | ||
</Alert> | ||
{:else if $data.__typename === 'InvalidNaisYamlError'} | ||
<!----> | ||
<Alert variant="error"> | ||
Nais-yaml might be invalid for application <strong>{job}</strong>. | ||
</Alert> | ||
{:else if $data.__typename === 'InboundAccessError'} | ||
{#if $data.rule.mutualExplanation !== 'NO_ZERO_TRUST' && $data.rule.mutualExplanation !== 'CLUSTER_NOT_FOUND'} | ||
<Alert variant="warning" | ||
><a | ||
href="/team/{$data.rule.namespace || team}/{$data.rule.cluster | ||
? $data.rule.cluster | ||
: env}/app/{$data.rule.application}" | ||
>{$data.rule.application}.{$data.rule.namespace || team}.{$data.rule.cluster | ||
? $data.rule.cluster | ||
: env}</a | ||
> | ||
is missing outbound rule for | ||
<a href="/team/{team}/{env}/job/{job}">{job}.{team}.{env}</a>. | ||
<br /> | ||
{#if $data.rule.mutualExplanation === 'APP_NOT_FOUND'} | ||
Verify outbound rules for | ||
<a | ||
href="/team/{$data.rule.namespace || team}/{$data.rule.cluster | ||
? $data.rule.cluster | ||
: env}/app/{$data.rule.application}/yaml">manifest</a | ||
>. Are namespace or cluster missing from rule? | ||
{:else if $data.rule.mutualExplanation === 'RULE_NOT_FOUND'} | ||
Please add outbound rule for {job}.{team}.{env} to | ||
<a | ||
href="/team/{$data.rule.namespace || team}/{$data.rule.cluster | ||
? $data.rule.cluster | ||
: env}/app/{$data.rule.application}/yaml">manifest</a | ||
>. | ||
{:else} | ||
<!--Please verify outbound rule for {app}. Check rule in | ||
<a href="/team/{team}/{env}/app/{app}/yaml">manifest</a>.--> | ||
{$data.rule.mutualExplanation} | ||
{/if} | ||
<br /> | ||
Consult | ||
<a href="https://docs.nais.io/nais-application/application/?h=#accesspolicy" | ||
>Nais Application reference - accessPolicy</a | ||
>.</Alert | ||
> | ||
{/if} | ||
{:else if $data.__typename === 'OutboundAccessError'} | ||
<Alert variant="warning" | ||
><a | ||
href="/team/{$data.rule.namespace || team}/{$data.rule.cluster | ||
? $data.rule.cluster | ||
: env}/app/{$data.rule.application}" | ||
>{$data.rule.application}.{$data.rule.namespace || team}.{$data.rule.cluster | ||
? $data.rule.cluster | ||
: env}</a | ||
> | ||
is missing inbound rule for | ||
<a href="/team/{team}/{env}/job/{job}">{job}.{team}.{env}</a>. | ||
<br /> | ||
{#if $data.rule.mutualExplanation == 'APP_NOT_FOUND'} | ||
Please verify inbound rule for {job}. Check rule in | ||
<a href="/team/{team}/{env}/app/{job}/yaml">manifest</a>. Are namespace or cluster missing | ||
from rule? | ||
{:else if $data.rule.mutualExplanation === 'RULE_NOT_FOUND'} | ||
Fant ikke | ||
{:else} | ||
{$data.rule.mutualExplanation} | ||
{/if} | ||
<br />Consult | ||
<a href="https://docs.nais.io/nais-application/application/?h=#accesspolicy" | ||
>Nais Application reference - accessPolicy</a | ||
>.</Alert | ||
> | ||
{:else if $data.__typename === 'FailedRunError'} | ||
<Alert variant="error"> | ||
{$data.runName} failed. {$data.runMessage}. Please consult the | ||
<a href="/team/{team}/{env}/job/{job}/logs?{$data.runName}">logs</a> if still available. | ||
</Alert> | ||
{:else} | ||
<Alert variant="error">Unkown error</Alert> | ||
{/if} | ||
</div> | ||
|
||
<style> | ||
.wrapper :global(.navds-alert__wrapper) { | ||
max-width: none; | ||
} | ||
.wrapper { | ||
padding-bottom: 1rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<script lang="ts"> | ||
import Nais from './icons/Nais.svelte'; | ||
import UnknownIcon from './icons/UnknownIcon.svelte'; | ||
import WarningIcon from './icons/WarningIcon.svelte'; | ||
export let state: string; | ||
export let size: string; | ||
</script> | ||
|
||
{#if state === 'NAIS'} | ||
<Nais {size} style="color: var(--a-icon-success)" aria-label="Application is nais" role="image" /> | ||
{:else if state === 'FAILING'} | ||
<WarningIcon | ||
{size} | ||
style="color: var(--a-icon-danger)" | ||
aria-label="Application is failing" | ||
role="image" | ||
/> | ||
{:else if state === 'NOTNAIS'} | ||
<Nais | ||
{size} | ||
style="color: var(--a-icon-warning)" | ||
aria-label="Application is not nais" | ||
role="image" | ||
/> | ||
{:else if state === 'UNKNOWN'} | ||
<UnknownIcon | ||
{size} | ||
style="color: var(--a-icon-warning)" | ||
aria-label="Unknown application status" | ||
role="image" | ||
/> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.