[6.8] [kbn/es] use an ES_TMPDIR that is within the install pat… (#47971)

* [kbn/es] use an ES_TMPDIR that is within the install path

* support tests which don't pass installPath

# Conflicts:
#	packages/kbn-es/src/cluster.js
#	packages/kbn-es/src/install/archive.js
This commit is contained in:
Spencer 2019-10-11 09:20:47 -07:00 committed by GitHub
parent c5889c7475
commit 5c42bd7c25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View file

@ -238,6 +238,10 @@ exports.Cluster = class Cluster {
this._process = execa(ES_BIN, args, {
cwd: installPath,
env: {
...(installPath ? { ES_TMPDIR: path.resolve(installPath, 'ES_TMPDIR') } : {}),
...process.env,
},
stdio: ['ignore', 'pipe', 'pipe'],
});

View file

@ -62,6 +62,10 @@ exports.installArchive = async function installArchive(archive, options = {}) {
await decompress(dest, installPath);
log.info('extracted to %s', chalk.bold(installPath));
const tmpdir = path.resolve(installPath, 'ES_TMPDIR');
fs.mkdirSync(tmpdir, { recursive: true });
log.info('created %s', chalk.bold(tmpdir));
if (license === 'trial') {
// starting in 6.3, security is disabled by default. Since we bootstrap
// the keystore, we can enable security ourselves.