Skip to content

Commit e5ebdf0

Browse files
authored
Merge branch 'main' into createRootlessMachine
Signed-off-by: tbabalov <[email protected]>
2 parents c0fbeec + 6bc1826 commit e5ebdf0

File tree

69 files changed

+2409
-639
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2409
-639
lines changed

CODEOWNERS

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
* @containers/podman-desktop-reviewers @benoitf
33

44
# website
5-
website/** @containers/podman-desktop-reviewers @slemeur @cdrage @benoitf
6-
website/docs/** @containers/podman-desktop-reviewers @shipsing @slemeur @cdrage @benoitf
5+
website/** @containers/podman-desktop-reviewers @slemeur @cdrage @benoitf @Firewall
6+
website/docs/** @containers/podman-desktop-reviewers @shipsing @slemeur @cdrage @benoitf @Firewall
77

88
# playwright tests
99
tests/playwright/** @containers/podman-desktop-reviewers @containers/podman-desktop-qe-reviewers @benoitf

extensions/kind/src/util.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { isAbsolute, join } from 'node:path';
2222

2323
import * as extensionApi from '@podman-desktop/api';
2424

25-
const macosExtraPath = '/usr/local/bin:/opt/homebrew/bin:/opt/local/bin:/opt/podman/bin';
25+
const macosExtraPath = '/opt/podman/bin:/usr/local/bin:/opt/homebrew/bin:/opt/local/bin';
2626
const localBinDir = '/usr/local/bin';
2727

2828
export function getSystemBinaryPath(binaryName: string): string {

extensions/podman/packages/extension/src/compatibility-mode.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ export class DarwinSocketCompatibility extends SocketCompatibility {
5252
// Find the podman-mac-helper binary which should only be located in either
5353
// brew or podman's install location
5454
findPodmanHelper(): string {
55-
const homebrewPath = '/opt/homebrew/bin/podman-mac-helper';
5655
const podmanPath = '/opt/podman/bin/podman-mac-helper';
56+
const homebrewPath = '/opt/homebrew/bin/podman-mac-helper';
5757
const userBinaryPath = '/usr/local/bin/podman-mac-helper';
5858

59-
if (fs.existsSync(homebrewPath)) {
60-
return homebrewPath;
61-
} else if (fs.existsSync(podmanPath)) {
59+
if (fs.existsSync(podmanPath)) {
6260
return podmanPath;
61+
} else if (fs.existsSync(homebrewPath)) {
62+
return homebrewPath;
6363
} else if (fs.existsSync(userBinaryPath)) {
6464
return userBinaryPath;
6565
} else {

extensions/podman/packages/extension/src/podman-cli.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import * as extensionApi from '@podman-desktop/api';
1919

2020
import { isMac, isWindows } from './util';
2121

22-
const macosExtraPath = '/usr/local/bin:/opt/homebrew/bin:/opt/local/bin:/opt/podman/bin';
22+
const macosExtraPath = '/opt/podman/bin:/usr/local/bin:/opt/homebrew/bin:/opt/local/bin';
2323

2424
export function getInstallationPath(): string | undefined {
2525
const env = process.env;

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@
115115
"@electron/fuses": "^1.8.0",
116116
"@eslint/compat": "^1.1.1",
117117
"@eslint/eslintrc": "^3.1.0",
118-
"@eslint/js": "^9.11.0",
118+
"@eslint/js": "^9.11.1",
119119
"@playwright/test": "1.47.2",
120120
"@podman-desktop/api": "workspace:",
121-
"@rollup/plugin-commonjs": "^26.0.1",
121+
"@rollup/plugin-commonjs": "^28.0.0",
122122
"@rollup/plugin-json": "^6.1.0",
123-
"@rollup/plugin-node-resolve": "^15.2.4",
123+
"@rollup/plugin-node-resolve": "^15.3.0",
124124
"@rollup/plugin-typescript": "^12.1.0",
125125
"@tsconfig/strictest": "^2.0.5",
126126
"@types/adm-zip": "^0.5.5",
@@ -132,16 +132,16 @@
132132
"@types/tar": "^6.1.13",
133133
"@types/tar-fs": "^2.0.4",
134134
"@types/validator": "^13.12.2",
135-
"@typescript-eslint/eslint-plugin": "^8.6.0",
136-
"@typescript-eslint/parser": "^8.6.0",
135+
"@typescript-eslint/eslint-plugin": "^8.7.0",
136+
"@typescript-eslint/parser": "^8.7.0",
137137
"@vitest/coverage-v8": "^2.0.5",
138138
"cross-env": "7.0.3",
139139
"dts-for-context-bridge": "0.7.1",
140140
"electron": "32.1.2",
141141
"electron-builder": "24.13",
142142
"electron-builder-notarize": "^1.5.2",
143143
"electron-devtools-installer": "^3.2.0",
144-
"eslint": "^9.11.0",
144+
"eslint": "^9.11.1",
145145
"eslint-import-resolver-custom-alias": "^1.3.2",
146146
"eslint-import-resolver-typescript": "^3.6.3",
147147
"eslint-plugin-etc": "^2.0.3",
@@ -164,7 +164,7 @@
164164
"prettier-plugin-svelte": "^3.2.6",
165165
"proxy": "^2.2.0",
166166
"typescript": "5.6.2",
167-
"typescript-eslint": "^8.6.0",
167+
"typescript-eslint": "^8.7.0",
168168
"validator": "^13.12.0",
169169
"vite": "^5.4.7",
170170
"vitest": "^2.0.5",

packages/main/src/plugin/color-registry.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1307,6 +1307,10 @@ export class ColorRegistry {
13071307
dark: colorPalette.red[500],
13081308
light: colorPalette.red[600],
13091309
});
1310+
this.registerColor(`${state}info`, {
1311+
dark: colorPalette.purple[500],
1312+
light: colorPalette.purple[600],
1313+
});
13101314
}
13111315

13121316
// colors for image files explorer

packages/main/src/plugin/docker-extension/docker-plugin-adapter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export interface RawExecResult {
3737
}
3838

3939
export class DockerPluginAdapter {
40-
static readonly MACOS_EXTRA_PATH = '/usr/local/bin:/opt/homebrew/bin:/opt/local/bin:/opt/podman/bin';
40+
static readonly MACOS_EXTRA_PATH = '/opt/podman/bin:/usr/local/bin:/opt/homebrew/bin:/opt/local/bin';
4141

4242
constructor(
4343
private contributionManager: ContributionManager,

packages/main/src/plugin/util/exec.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ describe('getInstallationPath', () => {
608608

609609
const path = getInstallationPath();
610610

611-
expect(path).toBe(`/usr/bin:${macosExtraPath}`);
611+
expect(path).toBe(`${macosExtraPath}:/usr/bin`);
612612
});
613613

614614
test('should return the installation path for macOS with defined param', () => {
@@ -619,7 +619,7 @@ describe('getInstallationPath', () => {
619619

620620
const path = getInstallationPath('/usr/other');
621621

622-
expect(path).toBe(`/usr/other:${macosExtraPath}`);
622+
expect(path).toBe(`${macosExtraPath}:/usr/other`);
623623
});
624624

625625
test('should return the installation path for other platforms', () => {

packages/main/src/plugin/util/exec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import * as sudo from 'sudo-prompt';
2525
import { isLinux, isMac, isWindows } from '../../util.js';
2626
import type { Proxy } from '../proxy.js';
2727

28-
export const macosExtraPath = '/usr/local/bin:/opt/homebrew/bin:/opt/local/bin:/opt/podman/bin';
28+
export const macosExtraPath = '/opt/podman/bin:/usr/local/bin:/opt/homebrew/bin:/opt/local/bin';
2929

3030
class RunErrorImpl extends Error implements RunError {
3131
constructor(
@@ -248,7 +248,7 @@ export function getInstallationPath(envPATH?: string): string {
248248
if (!envPATH) {
249249
return macosExtraPath;
250250
} else {
251-
return envPATH.concat(':').concat(macosExtraPath);
251+
return macosExtraPath.concat(':').concat(envPATH);
252252
}
253253
} else {
254254
return envPATH ?? '';

packages/renderer/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@tsconfig/svelte": "^5.0.4",
2525
"@types/js-yaml": "^4.0.9",
2626
"@types/validator": "^13.12.2",
27-
"@typescript-eslint/eslint-plugin": "^8.6.0",
27+
"@typescript-eslint/eslint-plugin": "^8.7.0",
2828
"@xterm/addon-serialize": "^0.13.0",
2929
"autoprefixer": "^10.4.20",
3030
"eslint-plugin-svelte": "^2.44.0",
@@ -37,12 +37,12 @@
3737
"monaco-editor": "^0.52.0",
3838
"postcss": "^8.4.47",
3939
"postcss-load-config": "^6.0.1",
40-
"svelte": "5.0.0-next.225",
40+
"svelte": "5.0.0-next.258",
4141
"svelte-check": "^4.0.2",
4242
"svelte-eslint-parser": "^0.41.1",
4343
"svelte-fa": "^4.0.2",
4444
"svelte-steps": "2.4.1",
45-
"tailwindcss": "^3.4.12",
45+
"tailwindcss": "^3.4.13",
4646
"tslib": "^2.7.0",
4747
"typescript": "^5.6.2",
4848
"vite": "^5.4.7",

packages/renderer/src/lib/compose/ComposeActions.spec.ts

+28-9
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,40 @@ import type { ContainerInfoUI } from '../container/ContainerInfoUI';
2525
import ComposeActions from './ComposeActions.svelte';
2626
import type { ComposeInfoUI } from './ComposeInfoUI';
2727

28-
const compose: ComposeInfoUI = {
29-
engineId: 'podman',
30-
engineType: 'podman',
31-
name: 'my-compose-group',
32-
status: 'STOPPED',
33-
actionInProgress: false,
34-
actionError: undefined,
35-
containers: [
28+
class ComposeInfoUIImpl implements ComposeInfoUI {
29+
#status: string = 'STOPPED';
30+
constructor(
31+
public engineId: string,
32+
public engineType: 'docker' | 'podman',
33+
public name: string,
34+
initialStatus: string,
35+
public actionInProgress: boolean,
36+
public actionError: string | undefined,
37+
public containers: ContainerInfoUI[],
38+
) {}
39+
set status(status: string) {
40+
this.#status = status;
41+
}
42+
get status(): string {
43+
return this.#status;
44+
}
45+
}
46+
47+
const compose: ComposeInfoUI = new ComposeInfoUIImpl(
48+
'podman',
49+
'podman',
50+
'my-compose-group',
51+
'STOPPED',
52+
false,
53+
undefined,
54+
[
3655
{
3756
actionInProgress: false,
3857
actionError: undefined,
3958
state: 'STOPPED',
4059
} as ContainerInfoUI,
4160
],
42-
} as ComposeInfoUI;
61+
);
4362

4463
const getContributedMenusMock = vi.fn();
4564
const updateMock = vi.fn();

packages/renderer/src/lib/container/ContainerActions.spec.ts

+18-4
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,24 @@ import { afterEach, beforeEach, expect, test, vi } from 'vitest';
2525
import ContainerActions from './ContainerActions.svelte';
2626
import type { ContainerInfoUI } from './ContainerInfoUI';
2727

28-
const container: ContainerInfoUI = {
29-
id: 'container-id',
30-
engineId: 'container-engine-id',
31-
} as ContainerInfoUI;
28+
class ContainerInfoUIImpl {
29+
#actionError: string = '';
30+
constructor(
31+
public id: string,
32+
public engineId: string,
33+
) {}
34+
set actionError(error: string) {
35+
this.#actionError = error;
36+
}
37+
get actionError(): string {
38+
return this.#actionError;
39+
}
40+
}
41+
42+
const container: ContainerInfoUI = new ContainerInfoUIImpl(
43+
'container-id',
44+
'container-engine-id',
45+
) as unknown as ContainerInfoUI;
3246

3347
const getContributedMenusMock = vi.fn();
3448
const updateMock = vi.fn();

packages/renderer/src/lib/dashboard/ProviderInstalled.spec.ts

+29-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,29 @@ vi.mock('@xterm/xterm', () => {
3636
};
3737
});
3838

39+
class InitializationContextImpl {
40+
#promise: unknown;
41+
#error: unknown;
42+
43+
constructor(public mode: string) {}
44+
45+
set promise(promise: unknown) {
46+
this.#promise = promise;
47+
}
48+
49+
get promise(): unknown {
50+
return this.#promise;
51+
}
52+
53+
set error(error: unknown) {
54+
this.#error = error;
55+
}
56+
57+
get error(): unknown {
58+
return this.#error;
59+
}
60+
}
61+
3962
// fake the window.events object
4063
beforeAll(() => {
4164
(window as any).ResizeObserver = vi.fn().mockReturnValue({ observe: vi.fn(), unobserve: vi.fn() });
@@ -70,7 +93,9 @@ test('Expect installed provider shows button', async () => {
7093
cleanupSupport: false,
7194
};
7295

73-
const initializationContext: InitializationContext = { mode: InitializeAndStartMode };
96+
const initializationContext: InitializationContext = new InitializationContextImpl(
97+
InitializeAndStartMode,
98+
) as unknown as InitializationContext;
7499
render(ProviderInstalled, { provider: provider, initializationContext: initializationContext });
75100

76101
const providerText = screen.getByText(content => content === 'MyProvider');
@@ -118,7 +143,9 @@ test('Expect to see the initialize context error if provider installation fails'
118143
cleanupSupport: false,
119144
};
120145

121-
const initializationContext: InitializationContext = { mode: InitializeAndStartMode };
146+
const initializationContext: InitializationContext = new InitializationContextImpl(
147+
InitializeAndStartMode,
148+
) as unknown as InitializationContext;
122149
render(ProviderInstalled, { provider: provider, initializationContext: initializationContext });
123150

124151
const providerText = screen.getByText(content => content === 'MyProvider');

packages/renderer/src/lib/dashboard/ProviderInstalled.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ function onInstallationClick() {
148148
</button>
149149
<button
150150
class="inline-block bg-purple-600 hover:bg-purple-500 text-[13px] text-white pt-2 pr-3 pl-3 pb-2 w-[32px]"
151+
aria-label="Installation options menu"
151152
on:click={() => updateOptionsMenu(!installationOptionsMenuVisible)}>
152153
<i class="fas fa-caret-down"></i>
153154
</button>

packages/renderer/src/lib/deployments/DeploymentActions.spec.ts

+30-9
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,36 @@ import type { DeploymentUI } from './DeploymentUI';
2727
const updateMock = vi.fn();
2828
const deleteMock = vi.fn();
2929

30-
const deployment: DeploymentUI = {
31-
name: 'my-deployment',
32-
status: 'RUNNING',
33-
namespace: '',
34-
replicas: 0,
35-
ready: 0,
36-
selected: false,
37-
conditions: [],
38-
};
30+
class DeploymentfUIImpl {
31+
#status: string;
32+
constructor(
33+
public name: string,
34+
initialStatus: string,
35+
public namespace: string,
36+
public replicas: number,
37+
public ready: number,
38+
public selected: boolean,
39+
public conditions: unknown[],
40+
) {
41+
this.#status = initialStatus;
42+
}
43+
set status(status: string) {
44+
this.#status = status;
45+
}
46+
get status(): string {
47+
return this.#status;
48+
}
49+
}
50+
51+
const deployment: DeploymentUI = new DeploymentfUIImpl(
52+
'my-deployment',
53+
'RUNNING',
54+
'',
55+
0,
56+
0,
57+
false,
58+
[],
59+
) as unknown as DeploymentUI;
3960

4061
beforeEach(() => {
4162
(window as any).kubernetesDeleteDeployment = deleteMock;

packages/renderer/src/lib/image/ImageActions.spec.ts

+19-4
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,24 @@ const fakedImage: ImageInfoUI = {
6161
name: 'dummy',
6262
} as unknown as ImageInfoUI;
6363

64+
class Image {
65+
#status: string;
66+
constructor(
67+
public name: string,
68+
initialStatus: string,
69+
) {
70+
this.#status = initialStatus;
71+
}
72+
73+
set status(status: string) {
74+
this.#status = status;
75+
}
76+
77+
get status(): string {
78+
return this.#status;
79+
}
80+
}
81+
6482
beforeEach(() => {
6583
vi.resetAllMocks();
6684
});
@@ -69,10 +87,7 @@ test('Expect showMessageBox to be called when error occurs', async () => {
6987
vi.mocked(withConfirmation).mockImplementation(f => f());
7088
getContributedMenusMock.mockImplementation(() => Promise.resolve([]));
7189

72-
const image: ImageInfoUI = {
73-
name: 'dummy',
74-
status: 'UNUSED',
75-
} as ImageInfoUI;
90+
const image: ImageInfoUI = new Image('dummy', 'UNUSED') as unknown as ImageInfoUI;
7691

7792
render(ImageActions, {
7893
onPushImage: vi.fn(),

0 commit comments

Comments
 (0)