forked from quay/claircore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreleases.go
148 lines (133 loc) · 3.24 KB
/
releases.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
package ubuntu
import (
"github.com/quay/claircore"
)
type Release string
const (
Artful Release = "artful" // deprecated
Bionic Release = "bionic"
Cosmic Release = "cosmic"
Disco Release = "disco"
Precise Release = "precise" // deprecated
Trusty Release = "trusty"
Xenial Release = "xenial"
Eoan Release = "eoan"
Focal Release = "focal"
)
var AllReleases = map[Release]struct{}{
Artful: struct{}{},
Bionic: struct{}{},
Cosmic: struct{}{},
Disco: struct{}{},
Precise: struct{}{},
Trusty: struct{}{},
Xenial: struct{}{},
Eoan: struct{}{},
Focal: struct{}{},
}
var ReleaseToVersionID = map[Release]string{
Artful: "17.10",
Bionic: "18.04",
Cosmic: "18.10",
Disco: "19.04",
Precise: "12.04",
Trusty: "14.04",
Xenial: "16.04",
Eoan: "19.10",
Focal: "20.04",
}
var artfulDist = &claircore.Distribution{
Name: "Ubuntu",
Version: "17.10 (Artful Aardvark)",
DID: "ubuntu",
PrettyName: "Ubuntu 17.10",
VersionID: "17.10",
VersionCodeName: "artful",
}
var bionicDist = &claircore.Distribution{
Name: "Ubuntu",
Version: "18.04.3 LTS (Bionic Beaver)",
DID: "ubuntu",
PrettyName: "Ubuntu 18.04.3 LTS",
VersionID: "18.04",
VersionCodeName: "bionic",
}
var cosmicDist = &claircore.Distribution{
Name: "Ubuntu",
Version: "18.10 (Cosmic Cuttlefish)",
DID: "ubuntu",
VersionID: "18.10",
VersionCodeName: "cosmic",
PrettyName: "Ubuntu 18.10",
}
var discoDist = &claircore.Distribution{
Name: "Ubuntu",
Version: "19.04 (Disco Dingo)",
DID: "ubuntu",
VersionID: "19.04",
VersionCodeName: "disco",
PrettyName: "Ubuntu 19.04",
}
var preciseDist = &claircore.Distribution{
Name: "Ubuntu",
Version: "12.04.5 LTS, Precise Pangolin",
DID: "ubuntu",
VersionID: "12.04",
PrettyName: "Ubuntu precise (12.04.5 LTS)",
}
var trustyDist = &claircore.Distribution{
Name: "Ubuntu",
Version: "14.04.6 LTS, Trusty Tahr",
DID: "ubuntu",
PrettyName: "Ubuntu 14.04.6 LTS",
VersionID: "14.04",
}
var xenialDist = &claircore.Distribution{
Name: "Ubuntu",
Version: "16.04.6 LTS (Xenial Xerus)",
DID: "ubuntu",
PrettyName: "Ubuntu 16.04.6 LTS",
VersionID: "16.04",
VersionCodeName: "xenial",
}
var eoanDist = &claircore.Distribution{
Name: "Ubuntu",
Version: "19.10 (Eoan Ermine)",
DID: "ubuntu",
PrettyName: "Ubuntu 19.10",
VersionID: "19.10",
VersionCodeName: "eoan",
}
var focalDist = &claircore.Distribution{
Name: "Ubuntu",
Version: "20.04 LTS (Focal Fossa)",
DID: "ubuntu",
PrettyName: "Ubuntu 20.04 LTS",
VersionID: "20.04",
VersionCodeName: "focal",
}
func releaseToDist(r Release) *claircore.Distribution {
switch r {
case Artful:
return artfulDist
case Bionic:
return bionicDist
case Cosmic:
return bionicDist
case Disco:
return discoDist
case Precise:
return preciseDist
case Trusty:
return trustyDist
case Xenial:
return xenialDist
case Eoan:
return eoanDist
case Focal:
return focalDist
default:
// return empty dist
return &claircore.Distribution{}
}
}