Skip to content
This repository was archived by the owner on Nov 28, 2025. It is now read-only.

Commit 1dda76a

Browse files
committed
chore(decom): Block post/put methods (HMS-5861)
1 parent fff6a95 commit 1dda76a

File tree

3 files changed

+28
-16
lines changed

3 files changed

+28
-16
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
**NOTE** As of August 31, the Launch (provisioning) service is no longer supported. You can use individual clouds in order to Launch an image.
2+
13
# provisioning-frontend
24

35
Provisioning frontend service for `console.redhat.com`

src/API/index.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ import axios from 'axios';
22
import { AZURE_PROVIDER } from '../constants';
33
import { LIMIT, imageBuilderURL, provisioningUrl } from './helpers';
44

5+
axios.interceptors.request.use(
6+
(config) => {
7+
if (process.env.NODE_ENV !== 'test' && (config.method === 'post' || config.method === 'put')) {
8+
return Promise.reject(new Error(`Write operations are not available in this environment, service is decommissioned`));
9+
}
10+
return config;
11+
},
12+
(error) => {
13+
return Promise.reject(error);
14+
}
15+
);
16+
517
const typesUrlForProvider = (provider, region) => {
618
switch (provider) {
719
case AZURE_PROVIDER:

src/mocks/handlers.js

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import { clonedImages, parentImage, successfulCloneStatus } from './fixtures/ima
77
import {
88
AWSReservation,
99
getAzureReservation,
10+
reservation,
11+
GCPReservation,
1012
createdAWSReservation,
1113
createdAzureReservation,
12-
reservation,
1314
createdGCPReservation,
14-
GCPReservation,
1515
} from './fixtures/reservation.fixtures';
1616
import { templates } from './fixtures/templates.fixtures';
1717

@@ -50,20 +50,6 @@ export const handlers = [
5050
http.get(imageBuilderURL(`clones/:id`), () => {
5151
return HttpResponse.json(successfulCloneStatus);
5252
}),
53-
http.post(provisioningUrl('pubkeys'), () => {
54-
return new HttpResponse(null, {
55-
status: 200,
56-
});
57-
}),
58-
http.post(provisioningUrl('reservations/azure'), () => {
59-
return HttpResponse.json(createdAzureReservation);
60-
}),
61-
http.post(provisioningUrl('reservations/gcp'), () => {
62-
return HttpResponse.json(createdGCPReservation);
63-
}),
64-
http.post(provisioningUrl('reservations/aws'), () => {
65-
return HttpResponse.json(createdAWSReservation);
66-
}),
6753
http.get(provisioningUrl('reservations/:id'), () => {
6854
return HttpResponse.json(reservation);
6955
}),
@@ -79,4 +65,16 @@ export const handlers = [
7965
http.get(provisioningUrl('sources/:id/launch_templates'), () => {
8066
return HttpResponse.json(templates);
8167
}),
68+
http.post(provisioningUrl('pubkeys'), () => {
69+
return HttpResponse.json({ id: 1 }, { status: 200 });
70+
}),
71+
http.post(provisioningUrl('reservations/azure'), () => {
72+
return HttpResponse.json(createdAzureReservation);
73+
}),
74+
http.post(provisioningUrl('reservations/gcp'), () => {
75+
return HttpResponse.json(createdGCPReservation);
76+
}),
77+
http.post(provisioningUrl('reservations/aws'), () => {
78+
return HttpResponse.json(createdAWSReservation);
79+
}),
8280
];

0 commit comments

Comments
 (0)