Skip to content

Commit

Permalink
To correctly report valid series
Browse files Browse the repository at this point in the history
  • Loading branch information
Aflynn50 committed Apr 26, 2024
1 parent 89c78b4 commit b0f8f3b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
4 changes: 2 additions & 2 deletions series/series_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions series/series_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
20 changes: 18 additions & 2 deletions series/supportedseries.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ var ubuntuSeries = map[string]SeriesVersionInfo{
"xenial": {
Version: "16.04",
LTS: true,
Supported: true,
ESMSupported: true,
},
"yakkety": {
Expand All @@ -187,7 +186,6 @@ var ubuntuSeries = map[string]SeriesVersionInfo{
"bionic": {
Version: "18.04",
LTS: true,
Supported: true,
ESMSupported: true,
},
"cosmic": {
Expand Down Expand Up @@ -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{
Expand Down
8 changes: 4 additions & 4 deletions series/supportedseries_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit b0f8f3b

Please sign in to comment.