[Screenshotting] Fix typo in warning logs regarding chromium's sandbox (#131584)

* [Screenshotting] fix typo and prevent linebreak in OS

* remove unnecessary messaging

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Tim Sullivan 2022-05-09 06:57:05 -07:00 committed by GitHub
parent 190ed558fa
commit 58f480b909
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View file

@ -114,10 +114,6 @@ export class HeadlessChromiumDriverFactory {
const dataDir = getDataPath();
fs.mkdirSync(dataDir, { recursive: true });
this.userDataDir = fs.mkdtempSync(path.join(dataDir, 'chromium-'));
if (this.config.browser.chromium.disableSandbox) {
logger.warn(`Enabling the Chromium sandbox provides an additional layer of protection.`);
}
}
private getChromiumArgs() {

View file

@ -24,13 +24,13 @@ export async function createConfig(parentLogger: Logger, config: ConfigType) {
// disableSandbox was not set by user, apply default for OS
const { os, disableSandbox } = await getDefaultChromiumSandboxDisabled();
const osName = [os.os, os.dist, os.release].filter(Boolean).map(upperFirst).join(' ');
const osName = [os.os, os.dist, os.release].filter(Boolean).map(upperFirst).join(' ').trim();
logger.debug(`Running on OS: '${osName}'`);
if (disableSandbox === true) {
logger.warn(
`Chromium sandbox provides an additional layer of protection, but is not supported for ${osName} OS. Automatically setting 'xpack.screenshotting.capture.browser.chromium.disableSandbox: true'.`
`Chromium sandbox provides an additional layer of protection, but is not supported for ${osName} OS. Automatically setting 'xpack.screenshotting.browser.chromium.disableSandbox: true'.`
);
} else {
logger.info(