Skip to content

Commit f0d5d10

Browse files
committed
frontend: hooks: fix useKubeObject to use standard websocket connection instead of multiplexed
1 parent eafba11 commit f0d5d10

File tree

16 files changed

+104
-33
lines changed

16 files changed

+104
-33
lines changed

frontend/src/components/crd/CustomResourceDetails.stories.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ export default {
4040
'http://localhost:4466/apis/my.phonyresources.io/v1/namespaces/mynamespace/mycustomresources/mycustomresource',
4141
() => HttpResponse.json(mockCRList[0])
4242
),
43-
http.get('http://localhost:4466/apis/my.phonyresources.io/v1/mycustomresources', () =>
44-
HttpResponse.json({})
43+
http.get(
44+
'http://localhost:4466/apis/my.phonyresources.io/v1/namespaces/mynamespace/mycustomresources',
45+
() => HttpResponse.json({})
4546
),
4647
http.get(
4748
'http://localhost:4466/apis/my.phonyresources.io/v1/mycustomresources/nonexistentcustomresource',

frontend/src/components/cronjob/CronJobDetails.stories.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ export default {
2828
msw: {
2929
handlers: {
3030
storyBase: [
31-
http.get('http://localhost:4466/apis/batch/v1/cronjobs', () => HttpResponse.json({})),
31+
http.get('http://localhost:4466/apis/batch/v1/namespaces/default/cronjobs', () =>
32+
HttpResponse.error()
33+
),
3234
http.get('http://localhost:4466/api/v1/namespaces/default/events', () =>
3335
HttpResponse.json({
3436
kind: 'EventList',

frontend/src/components/endpointSlices/EndpointSliceDetails.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ export default {
2727
msw: {
2828
handlers: {
2929
storyBase: [
30+
http.get(
31+
'http://localhost:4466/apis/discovery.k8s.io/v1/namespaces/my-namespace/endpointslices',
32+
() => HttpResponse.error()
33+
),
3034
http.get('http://localhost:4466/apis/discovery.k8s.io/v1/endpointslices', () =>
3135
HttpResponse.error()
3236
),

frontend/src/components/endpoints/EndpointDetails.stories.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ export default {
2727
msw: {
2828
handlers: {
2929
storyBase: [
30-
http.get('http://localhost:4466/api/v1/endpoints', () => HttpResponse.error()),
30+
http.get('http://localhost:4466/api/v1/namespaces/my-namespace/endpoints', () =>
31+
HttpResponse.error()
32+
),
3133
http.get('http://localhost:4466/api/v1/namespaces/my-namespace/events', () =>
3234
HttpResponse.error()
3335
),

frontend/src/components/gateway/BackendTLSPolicyDetails.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ export default {
3535
handlers: {
3636
story: [],
3737
storyBase: [
38+
http.get(
39+
'http://localhost:4466/apis/gateway.networking.k8s.io/v1alpha3/namespaces/default/backendtlspolicies',
40+
() => HttpResponse.error()
41+
),
3842
http.get(
3943
'http://localhost:4466/apis/gateway.networking.k8s.io/v1alpha3/namespaces/default/backendtlspolicies/example-policy',
4044
() => HttpResponse.json(DEFAULT_BACKEND_TLS_POLICY)

frontend/src/components/gateway/BackendTrafficPolicyDetails.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ export default {
3535
handlers: {
3636
story: [],
3737
storyBase: [
38+
http.get(
39+
'http://localhost:4466/apis/gateway.networking.x-k8s.io/v1alpha1/namespaces/default/xbackendtrafficpolicies',
40+
() => HttpResponse.error()
41+
),
3842
http.get(
3943
'http://localhost:4466/apis/gateway.networking.x-k8s.io/v1alpha1/namespaces/default/xbackendtrafficpolicies/example-traffic-policy',
4044
() => HttpResponse.json(DEFAULT_BACKEND_TRAFFIC_POLICY)

frontend/src/components/gateway/ReferenceGrantDetails.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default {
3939
story: [],
4040
storyBase: [
4141
http.get(
42-
'http://localhost:4466/apis/gateway.networking.k8s.io/v1beta1/referencegrants',
42+
'http://localhost:4466/apis/gateway.networking.k8s.io/v1beta1/namespaces/default/referencegrants',
4343
() => HttpResponse.json({})
4444
),
4545
http.get('http://localhost:4466/api/v1/namespaces/default/events', () =>

frontend/src/components/horizontalPodAutoscaler/HPADetails.stories.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,9 @@ export default {
134134
msw: {
135135
handlers: {
136136
storyBase: [
137-
http.get('http://localhost:4466/apis/autoscaling/v2/horizontalpodautoscalers', () =>
138-
HttpResponse.error()
137+
http.get(
138+
'http://localhost:4466/apis/autoscaling/v2/namespaces/my-namespace/horizontalpodautoscalers',
139+
() => HttpResponse.error()
139140
),
140141
http.get('http://localhost:4466/api/v1/namespaces/default/events', () =>
141142
HttpResponse.json({

frontend/src/components/networkpolicy/Details.stories.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,14 @@ Default.parameters = {
4848
'http://localhost:4466/apis/networking.k8s.io/v1/namespaces/default/networkpolicies/allow-frontend-traffic',
4949
() => HttpResponse.json(NETWORK_POLICY_DETAIL)
5050
),
51-
http.get('http://localhost:4466/apis/networking.k8s.io/v1/networkpolicies', () =>
52-
HttpResponse.json({
53-
kind: 'NetworkPolicyList',
54-
items: NETWORK_POLICY_ITEMS,
55-
metadata: {},
56-
})
51+
http.get(
52+
'http://localhost:4466/apis/networking.k8s.io/v1/namespaces/default/networkpolicies',
53+
() =>
54+
HttpResponse.json({
55+
kind: 'NetworkPolicyList',
56+
items: NETWORK_POLICY_ITEMS,
57+
metadata: {},
58+
})
5759
),
5860
http.get('http://localhost:4466/api/v1/namespaces/default/events', () =>
5961
HttpResponse.json({

frontend/src/components/pod/PodDetails.stories.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ Error.parameters = {
109109
handlers: {
110110
storyBase: null,
111111
story: [
112+
http.get('http://localhost:4466/api/v1/namespaces/default/pods', () =>
113+
HttpResponse.json({})
114+
),
112115
http.get('http://localhost:4466/api/v1/namespaces/default/pods/terminated', () =>
113116
HttpResponse.json(podList.find(pod => pod.metadata.name === 'terminated'))
114117
),

0 commit comments

Comments
 (0)