From d504a829543e1e457a775ef8a0cafbce155edae9 Mon Sep 17 00:00:00 2001 From: Spencer Date: Fri, 11 Oct 2019 09:21:13 -0700 Subject: [PATCH] =?UTF-8?q?[7.x]=20[kbn/es]=20use=20an=20ES=5FTMPDIR=20tha?= =?UTF-8?q?t=20is=20within=20the=20install=20pat=E2=80=A6=20(#47964)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [kbn/es] use an ES_TMPDIR that is within the install path * support tests which don't pass installPath --- packages/kbn-es/src/cluster.js | 1 + packages/kbn-es/src/install/archive.js | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/packages/kbn-es/src/cluster.js b/packages/kbn-es/src/cluster.js index 2c81035d5c25..665f80e3802e 100644 --- a/packages/kbn-es/src/cluster.js +++ b/packages/kbn-es/src/cluster.js @@ -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 || {}), diff --git a/packages/kbn-es/src/install/archive.js b/packages/kbn-es/src/install/archive.js index ba675ed6ac20..60c04d4aabca 100644 --- a/packages/kbn-es/src/install/archive.js +++ b/packages/kbn-es/src/install/archive.js @@ -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.