From b0f8f3b3ce21b944a6c81b7724d16edc42212a14 Mon Sep 17 00:00:00 2001 From: Alastair Flynn Date: Fri, 26 Apr 2024 08:51:10 +0100 Subject: [PATCH 1/2] To correctly report valid series --- series/series_linux.go | 4 ++-- series/series_linux_test.go | 4 ++-- series/supportedseries.go | 20 ++++++++++++++++++-- series/supportedseries_linux_test.go | 8 ++++---- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/series/series_linux.go b/series/series_linux.go index 7aeb242..c6c7496 100644 --- a/series/series_linux.go +++ b/series/series_linux.go @@ -106,14 +106,14 @@ func updateLocalSeriesVersions() error { supported := version.Supported(now) if us, ok := ubuntuSeries[seriesName]; ok { - us.Supported = supported + us.Supported = us.Supported && supported ubuntuSeries[seriesName] = us continue } ubuntuSeries[seriesName] = SeriesVersionInfo{ Version: version.Version, - Supported: supported, + Supported: false, ESMSupported: esm, LTS: version.LTS(), CreatedByLocalDistroInfo: true, diff --git a/series/series_linux_test.go b/series/series_linux_test.go index e4353c2..d613953 100644 --- a/series/series_linux_test.go +++ b/series/series_linux_test.go @@ -70,11 +70,11 @@ func (s *linuxVersionSuite) TestOSVersion(c *gc.C) { c.Assert(precise.CreatedByLocalDistroInfo, jc.IsFalse) c.Assert(precise.Supported, jc.IsFalse) - // Bionic isn't poly-filled and is supported. + // Bionic isn't poly-filled and isn't supported. bionic, ok := series["bionic"] c.Assert(ok, jc.IsTrue) c.Assert(bionic.CreatedByLocalDistroInfo, jc.IsFalse) - c.Assert(bionic.Supported, jc.IsTrue) + c.Assert(bionic.Supported, jc.IsFalse) // Spock is poly-filled and isn't supported. spock, ok := series["spock"] diff --git a/series/supportedseries.go b/series/supportedseries.go index 676cf8e..77a5fb8 100644 --- a/series/supportedseries.go +++ b/series/supportedseries.go @@ -172,7 +172,6 @@ var ubuntuSeries = map[string]SeriesVersionInfo{ "xenial": { Version: "16.04", LTS: true, - Supported: true, ESMSupported: true, }, "yakkety": { @@ -187,7 +186,6 @@ var ubuntuSeries = map[string]SeriesVersionInfo{ "bionic": { Version: "18.04", LTS: true, - Supported: true, ESMSupported: true, }, "cosmic": { @@ -223,6 +221,24 @@ var ubuntuSeries = map[string]SeriesVersionInfo{ Supported: false, ESMSupported: false, }, + "kinetic": { + Version: "22.10", + Supported: false, + }, + "lunar": { + Version: "23.04", + Supported: false, + }, + "mantic": { + Version: "23.10", + Supported: false, + }, + "noble": { + Version: "24.40", + LTS: true, + ESMSupported: false, + Supported: false, + }, } var nonUbuntuSeries = map[string]SeriesVersionInfo{ diff --git a/series/supportedseries_linux_test.go b/series/supportedseries_linux_test.go index e111233..0b3c7de 100644 --- a/series/supportedseries_linux_test.go +++ b/series/supportedseries_linux_test.go @@ -127,7 +127,7 @@ func (s *supportedSeriesSuite) TestSupportedJujuControllerSeries(c *gc.C) { c.Assert(err, jc.ErrorIsNil) s.PatchValue(series.UbuntuDistroInfoPath, filename) - expectedSeries := []string{"groovy", "focal", "bionic", "xenial"} + expectedSeries := []string{"focal"} series := series.SupportedJujuControllerSeries() c.Assert(series, jc.DeepEquals, expectedSeries) } @@ -139,7 +139,7 @@ func (s *supportedSeriesSuite) TestSupportedJujuWorkloadSeries(c *gc.C) { c.Assert(err, jc.ErrorIsNil) s.PatchValue(series.UbuntuDistroInfoPath, filename) - expectedSeries := []string{"groovy", "focal", "bionic", "xenial", "centos7", "centos8", "centos9", "genericlinux", "kubernetes", "opensuseleap", "win10", "win2008r2", "win2012", "win2012hv", "win2012hvr2", "win2012r2", "win2016", "win2016hv", "win2016nano", "win2019", "win7", "win8", "win81"} + expectedSeries := []string{"focal", "centos7", "centos8", "centos9", "genericlinux", "kubernetes", "opensuseleap", "win10", "win2008r2", "win2012", "win2012hv", "win2012hvr2", "win2012r2", "win2016", "win2016hv", "win2016nano", "win2019", "win7", "win8", "win81"} series := series.SupportedJujuWorkloadSeries() c.Assert(series, jc.DeepEquals, expectedSeries) } @@ -151,7 +151,7 @@ func (s *supportedSeriesSuite) TestSupportedJujuSeries(c *gc.C) { c.Assert(err, jc.ErrorIsNil) s.PatchValue(series.UbuntuDistroInfoPath, filename) - expectedSeries := []string{"groovy", "focal", "bionic", "xenial", "centos7", "centos8", "centos9", "genericlinux", "kubernetes", "opensuseleap", "win10", "win2008r2", "win2012", "win2012hv", "win2012hvr2", "win2012r2", "win2016", "win2016hv", "win2016nano", "win2019", "win7", "win8", "win81"} + expectedSeries := []string{"focal", "centos7", "centos8", "centos9", "genericlinux", "kubernetes", "opensuseleap", "win10", "win2008r2", "win2012", "win2012hv", "win2012hvr2", "win2012r2", "win2016", "win2016hv", "win2016nano", "win2019", "win7", "win8", "win81"} series := series.SupportedJujuSeries() c.Assert(series, jc.DeepEquals, expectedSeries) } @@ -184,7 +184,7 @@ func (s *supportedSeriesSuite) TestSetLatestLtsForTesting(c *gc.C) { func (s *supportedSeriesSuite) TestSupportedLts(c *gc.C) { got := series.SupportedLts() - want := []string{"xenial", "bionic", "focal"} + want := []string{"focal"} c.Assert(got, gc.DeepEquals, want) } From d8ace48ea67cd44cf53603211622d6ec239a2093 Mon Sep 17 00:00:00 2001 From: Alastair Flynn Date: Mon, 29 Apr 2024 10:34:00 +0100 Subject: [PATCH 2/2] Update supported series and mark jammy as supported --- series/supportedseries.go | 8 ++++++-- series/supportedseries_linux_test.go | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/series/supportedseries.go b/series/supportedseries.go index 77a5fb8..e4e149f 100644 --- a/series/supportedseries.go +++ b/series/supportedseries.go @@ -83,6 +83,10 @@ var seriesVersions = map[string]string{ "hirsute": "21.04", "impish": "21.10", "jammy": "22.04", + "kinetic": "22.10", + "lunar": "23.04", + "mantic": "23.10", + "noble": "24.04", "win2008r2": "win2008r2", "win2012hvr2": "win2012hvr2", "win2012hv": "win2012hv", @@ -218,8 +222,8 @@ var ubuntuSeries = map[string]SeriesVersionInfo{ "jammy": { Version: "22.04", LTS: true, - Supported: false, - ESMSupported: false, + Supported: true, + ESMSupported: true, }, "kinetic": { Version: "22.10", diff --git a/series/supportedseries_linux_test.go b/series/supportedseries_linux_test.go index 0b3c7de..29814e1 100644 --- a/series/supportedseries_linux_test.go +++ b/series/supportedseries_linux_test.go @@ -100,7 +100,7 @@ func (s *supportedSeriesSuite) TestESMSupportedJujuSeries(c *gc.C) { c.Assert(err, jc.ErrorIsNil) s.PatchValue(series.UbuntuDistroInfoPath, filename) - expectedSeries := []string{"focal", "bionic", "xenial", "trusty"} + expectedSeries := []string{"jammy", "focal", "bionic", "xenial", "trusty"} series := series.ESMSupportedJujuSeries() c.Assert(series, jc.DeepEquals, expectedSeries) } @@ -243,7 +243,7 @@ func (s *isolationSupportedSeriesSuite) TestBadFilePath(c *gc.C) { filename := filepath.Join(d, "bad-file.csv") s.PatchValue(series.UbuntuDistroInfoPath, filename) - expectedSeries := []string{"artful", "bionic", "centos7", "centos8", "centos9", "cosmic", "disco", "eoan", "focal", "genericlinux", "groovy", "hirsute", "impish", "jammy", "opensuseleap", "precise", "quantal", "raring", "saucy", "trusty", "utopic", "vivid", "wily", "win10", "win2008r2", "win2012", "win2012hv", "win2012hvr2", "win2012r2", "win2016", "win2016hv", "win2016nano", "win2019", "win7", "win8", "win81", "xenial", "yakkety", "zesty"} + expectedSeries := []string{"artful", "bionic", "centos7", "centos8", "centos9", "cosmic", "disco", "eoan", "focal", "genericlinux", "groovy", "hirsute", "impish", "jammy", "kinetic", "lunar", "mantic", "noble", "opensuseleap", "precise", "quantal", "raring", "saucy", "trusty", "utopic", "vivid", "wily", "win10", "win2008r2", "win2012", "win2012hv", "win2012hvr2", "win2012r2", "win2016", "win2016hv", "win2016nano", "win2019", "win7", "win8", "win81", "xenial", "yakkety", "zesty"} series := series.SupportedSeries() sort.Strings(series) c.Assert(series, gc.DeepEquals, expectedSeries)