From 5812e5b6295f9bc28d9898fda6cbff18199dbc85 Mon Sep 17 00:00:00 2001 From: Leonard Forsberg Date: Fri, 22 Dec 2023 00:44:12 +0100 Subject: [PATCH] fix oldest version for ubuntu 20.04 --- mongobin/downloadSpec.go | 2 +- mongobin/downloadSpec_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mongobin/downloadSpec.go b/mongobin/downloadSpec.go index 378cf79..cf7b53c 100644 --- a/mongobin/downloadSpec.go +++ b/mongobin/downloadSpec.go @@ -276,7 +276,7 @@ func osNameFromUbuntuRelease(majorVersion int, mongoVersion []int) string { if majorVersion >= 22 && versionGTE(mongoVersion, []int{6, 0, 4}) { return "ubuntu2204" } - if majorVersion >= 20 && versionGTE(mongoVersion, []int{4, 0, 1}) { + if majorVersion >= 20 && versionGTE(mongoVersion, []int{4, 4, 0}) { return "ubuntu2004" } if majorVersion >= 18 && versionGTE(mongoVersion, []int{4, 0, 1}) { diff --git a/mongobin/downloadSpec_test.go b/mongobin/downloadSpec_test.go index fe9d64e..bd34490 100644 --- a/mongobin/downloadSpec_test.go +++ b/mongobin/downloadSpec_test.go @@ -98,7 +98,7 @@ func TestMakeDownloadSpec(t *testing.T) { Platform: "linux", SSLBuildNeeded: false, Arch: "x86_64", - OSName: "ubuntu2204", + OSName: "ubuntu1804", }, }, "ubuntu 20.04": { @@ -110,7 +110,7 @@ func TestMakeDownloadSpec(t *testing.T) { Platform: "linux", SSLBuildNeeded: false, Arch: "x86_64", - OSName: "ubuntu2004", + OSName: "ubuntu1804", }, }, "arm64 ubuntu 20.04 and newer mongo": { @@ -531,14 +531,14 @@ func TestMakeDownloadSpec(t *testing.T) { etcFolder: "ubuntu2004", goArch: "arm64", - expectedError: "memongo does not support automatic downloading on your system: Mongo doesn't support your environment, ubuntu2004/arm64, on version 4.1.0", + expectedError: "memongo does not support automatic downloading on your system: Mongo doesn't support your environment, ubuntu1804/arm64, on version 4.1.0", // The OS name is wrong because we don't support Ubuntu 20.04 on Mongo 4.1.0 so it falls back to Ubuntu 18.04 }, "MongoDB Unsupported older version for arm64 ubuntu2204": { mongoVersion: "4.1.0", etcFolder: "ubuntu2204", goArch: "arm64", - expectedError: "memongo does not support automatic downloading on your system: Mongo doesn't support your environment, ubuntu2204/arm64, on version 4.1.0", + expectedError: "memongo does not support automatic downloading on your system: Mongo doesn't support your environment, ubuntu1804/arm64, on version 4.1.0", // The OS name is wrong because we don't support Ubuntu 22.04 on Mongo 4.1.0 so it falls back to Ubuntu 18.04 }, "MongoDB Unsupported older version for arm64 amazon2": { mongoVersion: "4.1.0",