Fix container resource sampling and surface collection failures
This commit is contained in:
@@ -15,6 +15,8 @@ interface AllowanceRow {
|
||||
function database() { const handle = db(); ensureHostSchema(handle); return handle; }
|
||||
|
||||
export function validateInstanceResources(inventory: HostInventory): void {
|
||||
if (inventory.instanceResourcesError !== undefined && (typeof inventory.instanceResourcesError !== 'string'
|
||||
|| inventory.instanceResourcesError.length > 500)) throw new Error('Invalid instance resource sampling error.');
|
||||
const samples = inventory.instanceResources;
|
||||
if (samples === undefined) return;
|
||||
if (!Array.isArray(samples) || samples.length > 1000) throw new Error('Invalid instance resource samples.');
|
||||
|
||||
Reference in New Issue
Block a user