Skip to content

Commit

Permalink
fix(MongoBinaryDownloadUrl): support ubuntu 22.04 ^6.0.4
Browse files Browse the repository at this point in the history
fixes #732
  • Loading branch information
hasezoey committed Jan 19, 2023
1 parent 4498e17 commit 6598792
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/guides/supported-systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Architectures Supported: `x86_64`, `arm64`(`aarch64`)
Lower Versions than `2004` may be used if mongodb dosnt provide binaries for an lower version of mongodb for an higher version of ubuntu
:::
:::note
There are currently no native binaries for `2204`, so it is mapped to `2004` and will require `libssl1.1` to be installed.
Since Mongodb `6.0.4` there are binaries for `2204`, any version before is mapped to `2204` (or earlier) and will require `libssl1.1` to be installed.
See [this mongodb issue](https://jira.mongodb.org/browse/SERVER-62300).
:::

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,9 +513,8 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {
return 'ubuntu1804';
}

// there are not binaries for ubuntu 21.04, so defaulting to one version below for now
// see https://github.com/nodkz/mongodb-memory-server/issues/582
if (ubuntuYear >= 21) {
// there are only binaries for 2204 since 6.0.4 (and not binaries for ubuntu2104)
if (ubuntuYear >= 21 && semver.satisfies(coercedVersion, '<6.0.4')) {
return 'ubuntu2004';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ describe('MongoBinaryDownloadUrl', () => {
);
});

it('for ubuntu 22.04 for 4.0', async () => {
it('for ubuntu 22.04 for 4.0 (using 1804)', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
Expand All @@ -192,7 +192,7 @@ describe('MongoBinaryDownloadUrl', () => {
);
});

it('for ubuntu 22.04 for 4.4', async () => {
it('for ubuntu 22.04 for 4.4 (using 2004)', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
Expand Down Expand Up @@ -224,7 +224,7 @@ describe('MongoBinaryDownloadUrl', () => {
);
});

it('for ubuntu 22.04 for 5.0', async () => {
it('for ubuntu 22.04 for 5.0 (using 2004)', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
Expand Down Expand Up @@ -256,7 +256,7 @@ describe('MongoBinaryDownloadUrl', () => {
);
});

it('for ubuntu 22.04 for 6.0', async () => {
it('for ubuntu 22.04 for 6.0 (using 2004)', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
Expand All @@ -272,6 +272,22 @@ describe('MongoBinaryDownloadUrl', () => {
);
});

it('for ubuntu 22.04 for 6.0.4', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: '6.0.4',
os: {
os: 'linux',
dist: 'ubuntu',
release: '22.04',
},
});
expect(await du.getDownloadUrl()).toBe(
'https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-6.0.4.tgz'
);
});

it('should allow v5.0-latest', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
Expand Down

0 comments on commit 6598792

Please sign in to comment.