mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
[revert this] try and read instance data file instead
This commit is contained in:
parent
0dc497bd72
commit
ebdea2115d
1 changed files with 8 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
|||
|
||||
import type { Logger } from '@kbn/core/server';
|
||||
import type { CloudSetup } from '@kbn/cloud-plugin/server';
|
||||
import fs from 'fs';
|
||||
import { readMemoryLimit } from './read_cgroup_mem_limit';
|
||||
|
||||
const MIN_CLOUD_OS_MEM_GB: number = 2;
|
||||
|
@ -24,6 +25,13 @@ export function systemHasInsufficientMemory(
|
|||
logger.fatal(`TEST isCloudEnabled ${Boolean(cloud?.isCloudEnabled)}`);
|
||||
logger.fatal(`TEST hasDeploymentId ${Boolean(cloud?.deploymentId)}`);
|
||||
logger.fatal(`TEST has cloud ${Boolean(cloud?.isCloudEnabled || cloud?.deploymentId)}`);
|
||||
const rootFiles = fs.readdirSync('/');
|
||||
logger.fatal(`${rootFiles}`);
|
||||
const f = rootFiles.find((file) => file.match(/instance.*data.*\.json$/i));
|
||||
if (f) {
|
||||
logger.fatal(`matched ${f}`);
|
||||
logger.fatal(`${fs.readFileSync(f).toString()}`);
|
||||
}
|
||||
if (!Boolean(cloud?.isCloudEnabled || cloud?.deploymentId)) return false;
|
||||
const limit = readMemoryLimit();
|
||||
logger.fatal(`TEST memory limit from cgroups ${limit}`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue