fix: add suggestion when WSL seems to require a reboot (#7007)

Signed-off-by: lstocchi <lstocchi@redhat.com>
This commit is contained in:
Luca Stocchi 2024-04-30 11:17:39 +02:00 committed by GitHub
parent c132164cb4
commit 341e70d1cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -503,6 +503,10 @@ test('expect winWSL2 preflight check return failure result if the machine has WS
expect(result.description).equal(
'WSL2 seems to be installed but the system needs to be restarted so the changes can take effect.',
);
expect(result.docLinksDescription).equal(
`If already restarted, call 'wsl --install --no-distribution' in a terminal.`,
);
expect(result.docLinks[0].url).equal('https://learn.microsoft.com/en-us/windows/wsl/install');
});
test('expect winWSL2 preflight check return successful result if the machine has WSL2 installed and the reboot check fails with a code different from WSL_E_WSL_OPTIONAL_COMPONENT_REQUIRED', async () => {

View file

@ -666,6 +666,11 @@ class WSL2Check extends BaseCheck {
return this.createFailureResult({
description:
'WSL2 seems to be installed but the system needs to be restarted so the changes can take effect.',
docLinksDescription: `If already restarted, call 'wsl --install --no-distribution' in a terminal.`,
docLinks: {
url: 'https://learn.microsoft.com/en-us/windows/wsl/install',
title: 'WSL2 Manual Installation Steps',
},
});
}
} catch (err) {