Skip to content

Commit

Permalink
fix(MongoBinaryDownloadUrl): change default elementary version to 7
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Jun 8, 2024
1 parent df97ea8 commit ecc4ffe
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/guides/supported-systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Default version is `1`
(uses mongodb's `ubuntu` release)<br/>
Lowest supported Distribution version is `3` (or `0.3`)<br/>
Highest version is `7`<br/>
Default version is `6`
Default version is `7`

### Linux Mint

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,13 @@ export class MongoBinaryDownloadUrl implements MongoBinaryDownloadUrlOpts {

// untangle elemenatary versioning from hell https://en.wikipedia.org/wiki/Elementary_OS#Development
const [elementaryMajor, elementaryMinor] = os.release.split('.').map((el) => parseInt(el));
// versions below 5.0 were named 0.X, and so use the minor version if major is 0
const realMajor = elementaryMajor || elementaryMinor;

ubuntuOS = {
os: 'linux',
dist: 'ubuntu',
// TODO: next-minor: change default elemenatry release to 7
release: elementaryToUbuntuRelease[realMajor] || elementaryToUbuntuRelease[6],
release: elementaryToUbuntuRelease[realMajor] || elementaryToUbuntuRelease[7],
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,25 @@ describe('MongoBinaryDownloadUrl', () => {
});

describe('for elementary', () => {
it('should default to Elementary 7, if version cannot be found in lookup table', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
arch: 'x64',
version: '6.0.4',
os: {
os: 'linux',
dist: 'elementary',
codename: 'horus',
release: '0',
id_like: ['ubuntu'],
},
});

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

it('should return a archive name for elementary 0.3', async () => {
const du = new MongoBinaryDownloadUrl({
platform: 'linux',
Expand Down

0 comments on commit ecc4ffe

Please sign in to comment.