From b0f8f3b3ce21b944a6c81b7724d16edc42212a14 Mon Sep 17 00:00:00 2001 From: Alastair Flynn Date: Fri, 26 Apr 2024 08:51:10 +0100 Subject: [PATCH] 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) }