@kumori/aurora-backend-handler 1.1.45 → 1.1.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/helpers/revision-helper.ts +17 -1
- package/package.json +1 -1
|
@@ -199,14 +199,30 @@ const createRevision = (
|
|
|
199
199
|
},
|
|
200
200
|
cost: 0,
|
|
201
201
|
},
|
|
202
|
-
status: eventData.status
|
|
202
|
+
status: handleRevisionStatus(eventData.status),
|
|
203
203
|
errorCode: eventData.status?.error ? eventData.status.error.code : "",
|
|
204
204
|
errorMsg: eventData.status?.error ? eventData.status.error.message : "",
|
|
205
205
|
createdAt:
|
|
206
206
|
(eventData.status && eventData.status.runtime?.status?.createdAt) || "",
|
|
207
207
|
};
|
|
208
208
|
};
|
|
209
|
+
const handleRevisionStatus = (revisionStatus: any) => {
|
|
210
|
+
for (const roleData of Object.values<any>(revisionStatus.runtime.roles)) {
|
|
211
|
+
for (const instanceData of Object.values<any>(roleData.instances)) {
|
|
212
|
+
for (const container of Object.values<any>(instanceData.containers ?? {})) {
|
|
213
|
+
if (!container.status.ready) {
|
|
214
|
+
return {
|
|
215
|
+
code: container.status.status.waiting?.reason ?? "ContainerNotReady",
|
|
216
|
+
message: container.status.status.waiting?.message ?? "One or more containers are not ready for unknown reasons.",
|
|
217
|
+
timestamp: Date.now().toString(),
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
209
223
|
|
|
224
|
+
return revisionStatus?.state;
|
|
225
|
+
};
|
|
210
226
|
const updateServiceWithRevision = (
|
|
211
227
|
existingService: Service,
|
|
212
228
|
entityId: string,
|