Skip to content

Commit

Permalink
Merge pull request #7511 from mook-as/diagnostics/docker-cli-plugins-…
Browse files Browse the repository at this point in the history
…directory-change

Diagnostics: docker-cli-plugins: Update directory
  • Loading branch information
jandubois authored Sep 19, 2024
2 parents 507747a + 8e4a26e commit 2fab96e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import paths from '@pkg/utils/paths';

// Mock fs.promises.readdir() for the default export.
jest.spyOn(fs.promises, 'readdir').mockImplementation((dir, encoding) => {
expect(dir).toEqual(path.join(appDir, 'resources', os.platform(), 'bin'));
expect(dir).toEqual(path.join(appDir, 'resources', os.platform(), 'docker-cli-plugins'));
expect(encoding).toEqual('utf-8');

return Promise.resolve([]);
Expand All @@ -49,7 +49,7 @@ describeUnix(CheckerDockerCLISymlink, () => {
const resourcesDir = path.join(appDir, 'resources');

await fs.promises.mkdir(resourcesDir);
appDirExecutable = path.join(resourcesDir, os.platform(), 'bin', executable);
appDirExecutable = path.join(resourcesDir, os.platform(), 'docker-cli-plugins', executable);
replacedPathsResources = jest.replaceProperty(paths, 'resources', resourcesDir);
});
afterAll(async() => {
Expand Down
7 changes: 3 additions & 4 deletions pkg/rancher-desktop/main/diagnostics/dockerCliSymlinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class CheckerDockerCLISymlink implements DiagnosticsChecker {
const displayableStartingPath = replaceHome(startingPath);
const rdBinPath = path.join(paths.integration, this.name);
const displayableRDBinPath = replaceHome(rdBinPath);
const finalTarget = path.join(paths.resources, os.platform(), 'bin', this.name);
const finalTarget = path.join(paths.resources, os.platform(), 'docker-cli-plugins', this.name);
const displayableFinalTarget = replaceHome(finalTarget);
let state;
let description = `The file \`${ displayableStartingPath }\``;
Expand Down Expand Up @@ -124,9 +124,8 @@ export class CheckerDockerCLISymlink implements DiagnosticsChecker {
}

const dockerCliSymlinkCheckers: Promise<DiagnosticsChecker[]> = (async() => {
const resourcesDir = path.join(paths.resources, os.platform(), 'bin');
const allNames = await fs.promises.readdir(resourcesDir, 'utf-8');
const names = allNames.filter(name => name.startsWith('docker-') && !name.startsWith('docker-credential-'));
const resourcesDir = path.join(paths.resources, os.platform(), 'docker-cli-plugins');
const names = await fs.promises.readdir(resourcesDir, 'utf-8');

return names.map((name) => {
return new CheckerDockerCLISymlink(name);
Expand Down

0 comments on commit 2fab96e

Please sign in to comment.