Skip to content

Commit 93ea60d

Browse files
committed
Forward cookies to api
1 parent 46227aa commit 93ea60d

7 files changed

+19
-9
lines changed

charts/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ apiVersion: v2
22
name: console-frontend
33
description: Frontend for NAIS console
44
type: application
5-
version: 1.0.0
5+
version: 2024-02-13-104003-46227aa
66
sources:
77
- https://github.com/nais/console-frontend/tree/main/charts

charts/templates/deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ spec:
3232
image: '{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Chart.Version }}'
3333
ports:
3434
- name: http
35-
containerPort: 8080
35+
containerPort: 3000
3636
protocol: TCP
3737
resources:
3838
requests:

charts/templates/ingress.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
annotations:
77
nginx.ingress.kubernetes.io/proxy-buffer-size: 8k
88
spec:
9-
ingressClassName: nais-ingress-iap
9+
ingressClassName: nais-ingress
1010
rules:
1111
- host: '{{ .Values.host }}'
1212
http:

charts/templates/networkpolicy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ spec:
1212
- to:
1313
- podSelector:
1414
matchLabels:
15-
app: console-backend
15+
app: nais-api
1616
podSelector:
1717
matchLabels:
1818
app: '{{ .Release.Name }}'

charts/templates/service.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ spec:
66
type: ClusterIP
77
ports:
88
- port: 80
9-
targetPort: 3000
9+
targetPort: http
1010
protocol: TCP
1111
name: http
1212
selector:

src/hooks.server.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import type { HandleFetch } from '@sveltejs/kit';
2+
3+
export const handle: HandleFetch = async ({ event, request, fetch }) => {
4+
if (request.url.startsWith('http://nais-api/') && event.request.headers.has('cookie')) {
5+
request.headers.set('cookie', event.request.headers.get('cookie')!);
6+
}
7+
8+
return fetch(request);
9+
};

src/lib/AppErrorTypeToMessage.svelte

+5-4
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,16 @@
101101
{:else if $data.__typename === 'InvalidNaisYamlError'}
102102
<div class="wrapper">
103103
<Alert variant="error">
104-
The nais.yaml spec is invalid for application <strong>{app}</strong>.
105-
<br>{$data.detail}
104+
The nais.yaml spec is invalid for application <strong>{app}</strong>.
105+
<br />{$data.detail}
106106
</Alert>
107107
</div>
108108
{:else if $data.__typename === 'SynchronizationFailingError'}
109109
<div class="wrapper">
110110
<Alert variant="error">
111-
Application <strong>{app}</strong> failed to synchronize properly. The operation will be retried.
112-
<br>{$data.detail}
111+
Application <strong>{app}</strong> failed to synchronize properly. The operation will be
112+
retried.
113+
<br />{$data.detail}
113114
</Alert>
114115
</div>
115116
{:else if $data.__typename === 'NewInstancesFailingError'}

0 commit comments

Comments
 (0)