Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Commit

Permalink
fix(latest): allow
Browse files Browse the repository at this point in the history
":latest" image tag
  • Loading branch information
agorskiy12 committed Mar 22, 2024
1 parent 62854c6 commit 9543edb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions packages/one-app-runner/__tests__/src/startApp.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,18 @@ Array [
);
});

it('adds node flags when one-app version is :latest', async () => {
expect.assertions(1);
const mockSpawn = makeMockSpawn();
childProcess.spawn.mockImplementation(mockSpawn);
await startApp({
moduleMapUrl: 'https://example.com/module-map.json', rootModuleName: 'frank-lloyd-root', appDockerImage: 'one-app:latest', modulesToServe: ['/path/to/module-a'],
});
expect(mockSpawn.calls[1].args[mockSpawn.calls[1].args.indexOf('-c') + 1]).toMatch(
'--dns-result-order=ipv4first --no-experimental-fetch'
);
});

it('adds node flags when one-app version is greater than 5.13.0', async () => {
expect.assertions(1);
const mockSpawn = makeMockSpawn();
Expand Down
2 changes: 1 addition & 1 deletion packages/one-app-runner/src/startApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const generateDebug = (port, useDebug) => (useDebug ? `--inspect=0.0.0.0:${port}
// So we have to remove those flags if the one-app version is less than 5.13.0
// 5.13.0 is when node 16 was introduced.
const generateNodeFlags = (appVersion) => {
if (semver.intersects(appVersion, '^5.13.0', { includePrerelease: true })) {
if (appVersion === 'latest' ? true : semver.intersects(appVersion, '^5.13.0', { includePrerelease: true })) {
return '--dns-result-order=ipv4first --no-experimental-fetch';
}
return '';
Expand Down

0 comments on commit 9543edb

Please sign in to comment.