@kumori/aurora-backend-handler 1.1.71 → 1.1.73
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.
|
@@ -98,7 +98,7 @@ const parseKeyPath = (key: string): { [entity: string]: string } => {
|
|
|
98
98
|
return result;
|
|
99
99
|
};
|
|
100
100
|
|
|
101
|
-
const getDefaultUsage = (): Usage => ({
|
|
101
|
+
const getDefaultUsage = (eventData?: any): Usage => ({
|
|
102
102
|
current: {
|
|
103
103
|
cpu: 0,
|
|
104
104
|
memory: 0,
|
|
@@ -108,12 +108,12 @@ const getDefaultUsage = (): Usage => ({
|
|
|
108
108
|
persistentStorage: 0,
|
|
109
109
|
},
|
|
110
110
|
limit: {
|
|
111
|
-
cpu: { max: 0, min: 0 },
|
|
112
|
-
memory: { max: 0, min: 0 },
|
|
113
|
-
storage: { max: 0, min: 0 },
|
|
114
|
-
volatileStorage: { max: 0, min: 0 },
|
|
115
|
-
nonReplicatedStorage: { max: 0, min: 0 },
|
|
116
|
-
persistentStorage: { max: 0, min: 0 },
|
|
111
|
+
cpu: { max: eventData.vcpu || 0, min: eventData.vcpu || 0 },
|
|
112
|
+
memory: { max: eventData.ram || 0, min: eventData.ram || 0 },
|
|
113
|
+
storage: { max: eventData.shared_disk || 0, min: eventData.shared_disk || 0 },
|
|
114
|
+
volatileStorage: { max: eventData.volatile_disk || 0, min: eventData.volatile_disk || 0 },
|
|
115
|
+
nonReplicatedStorage: { max: eventData.persistent_disk || 0, min: eventData.persistent_disk || 0 },
|
|
116
|
+
persistentStorage: { max: eventData.persistent_disk || 0, min: eventData.persistent_disk || 0 },
|
|
117
117
|
},
|
|
118
118
|
cost: 0,
|
|
119
119
|
});
|
|
@@ -193,7 +193,12 @@ export const handleServiceEvent = ({
|
|
|
193
193
|
|
|
194
194
|
const projectLabel = eventData.meta?.labels?.project;
|
|
195
195
|
const serviceRoles = roleMap.get(serviceFullKey) || [];
|
|
196
|
-
const serviceUsage = currentRevision?.usage || getDefaultUsage();
|
|
196
|
+
const serviceUsage = currentRevision?.usage || getDefaultUsage(eventData);
|
|
197
|
+
console.log("DEBUG currentRevision", currentRevision);
|
|
198
|
+
console.log("DEBUG currentRevision.usage", currentRevision?.usage);
|
|
199
|
+
console.log("DEBUG defaultData", getDefaultUsage(eventData));
|
|
200
|
+
console.log("DEBUG: serviceUsage", serviceUsage);
|
|
201
|
+
|
|
197
202
|
|
|
198
203
|
const serviceRevisions: Revision[] = [];
|
|
199
204
|
revisionsMap.forEach((revision, key) => {
|