Skip to content

Commit

Permalink
feat(MongoDownloadUrl): add support for amazon linux 2023 (#826)
Browse files Browse the repository at this point in the history
* fix: add support for amazon linux 2023

The os string in the download url for amazon linux 2023 should be "amazon2023"

* test: added test for Amazon 2023 download url
  • Loading branch information
georgehb authored Nov 4, 2023
1 parent 3cdbed2 commit ec1ea68
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
let name = 'amazon';
const release: number = parseInt(os.release, 10);

if (release >= 2 && release <= 3) {
name += '2';
if (release >= 2) {
name += release.toString();
}
// dont add anthing as fallback, because for "amazon 1", mongodb just uses "amazon"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,24 @@ describe('MongoBinaryDownloadUrl', () => {
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon2-4.0.24.tgz'
);
});

it('should return a archive name for Amazon 2023', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: '7.0.2',
os: {
os: 'linux',
dist: 'amzn',
release: '2023',
id_like: ['fedora'],
},
});

expect(await du.getDownloadUrl()).toBe(
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-amazon2023-7.0.2.tgz'
);
});
});

describe('for rhel', () => {
Expand Down

0 comments on commit ec1ea68

Please sign in to comment.