[7.x] [kbn/es] use an ES_TMPDIR that is within the install pat… (#47964)

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

* support tests which don't pass installPath
This commit is contained in:
Spencer 2019-10-11 09:21:13 -07:00 committed by GitHub
parent a133b5fb13
commit d504a82954
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -278,6 +278,7 @@ exports.Cluster = class Cluster {
this._process = execa(ES_BIN, args, {
cwd: installPath,
env: {
...(installPath ? { ES_TMPDIR: path.resolve(installPath, 'ES_TMPDIR') } : {}),
...process.env,
...(options.bundledJDK ? { JAVA_HOME: '' } : {}),
...(options.esEnvVars || {}),

View file

@ -65,6 +65,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 !== 'oss') {
// starting in 6.3, security is disabled by default. Since we bootstrap
// the keystore, we can enable security ourselves.