Skip to content

Commit

Permalink
alpine: add new releases
Browse files Browse the repository at this point in the history
Add new Alpine releases 3.13 and 3.14
  • Loading branch information
SofyaTavrovskaya authored and hdonnay committed Sep 13, 2021
1 parent c0a71c6 commit 945cdf5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
8 changes: 8 additions & 0 deletions alpine/distributionscanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ type alpineRegex struct {
// and the issue string in the issue file
// ex: "Welcome to Alpine Linux 3.3"
var alpineRegexes = []alpineRegex{
{
dist: alpine3_14Dist,
regexp: regexp.MustCompile(`Alpine Linux v?3\.14`),
},
{
dist: alpine3_13Dist,
regexp: regexp.MustCompile(`Alpine Linux v?3\.13`),
},
{
dist: alpine3_12Dist,
regexp: regexp.MustCompile(`Alpine Linux v?3\.12`),
Expand Down
26 changes: 26 additions & 0 deletions alpine/distributionscanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ func TestDistributionScanner(t *testing.T) {
OSRelease: v3_12_OSRelease,
Issue: v3_12_Issue,
},
{
Release: V3_13,
OSRelease: v3_13_OSRelease,
Issue: v3_13_Issue,
},
{
Release: V3_14,
OSRelease: v3_14_OSRelease,
Issue: v3_14_Issue,
},
}
for _, tt := range table {
t.Run(string(tt.Release), func(t *testing.T) {
Expand Down Expand Up @@ -164,5 +174,21 @@ PRETTY_NAME="Alpine Linux v3.12"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"`
v3_12_Issue = `Welcome to Alpine Linux 3.12
Kernel \r on an \m (\l)`
v3_13_OSRelease = `NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.13.4
PRETTY_NAME="Alpine Linux v3.13"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"`
v3_13_Issue = `Welcome to Alpine Linux 3.13
Kernel \r on an \m (\l)`
v3_14_OSRelease = `NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.14.1
PRETTY_NAME="Alpine Linux v3.14"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://bugs.alpinelinux.org/"`
v3_14_Issue = `Welcome to Alpine Linux 3.14
Kernel \r on an \m (\l)`
)
8 changes: 8 additions & 0 deletions alpine/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ type Release string

// These are known releases.
const (
V3_14 Release = "v3.14"
V3_13 Release = "v3.13"
V3_12 Release = "v3.12"
V3_11 Release = "v3.11"
V3_10 Release = "v3.10"
Expand Down Expand Up @@ -54,6 +56,8 @@ var (
alpine3_10Dist = mkdist(3, 10)
alpine3_11Dist = mkdist(3, 11)
alpine3_12Dist = mkdist(3, 12)
alpine3_13Dist = mkdist(3, 13)
alpine3_14Dist = mkdist(3, 14)
)

func releaseToDist(r Release) *claircore.Distribution {
Expand All @@ -78,6 +82,10 @@ func releaseToDist(r Release) *claircore.Distribution {
return alpine3_11Dist
case V3_12:
return alpine3_12Dist
case V3_13:
return alpine3_13Dist
case V3_14:
return alpine3_14Dist
default:
// return empty dist
return &claircore.Distribution{}
Expand Down
4 changes: 2 additions & 2 deletions alpine/updaterset.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import (
)

var alpineMatrix = map[Repo][]Release{
Main: []Release{V3_12, V3_11, V3_10, V3_9, V3_8, V3_7, V3_6, V3_5, V3_4, V3_3},
Community: []Release{V3_12, V3_11, V3_10, V3_9, V3_8, V3_7, V3_6, V3_5, V3_4, V3_3},
Main: []Release{V3_14, V3_13, V3_12, V3_11, V3_10, V3_9, V3_8, V3_7, V3_6, V3_5, V3_4, V3_3},
Community: []Release{V3_14, V3_13, V3_12, V3_11, V3_10, V3_9, V3_8, V3_7, V3_6, V3_5, V3_4, V3_3},
}

func UpdaterSet(_ context.Context) (driver.UpdaterSet, error) {
Expand Down

0 comments on commit 945cdf5

Please sign in to comment.