forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
s2i_images.go
99 lines (91 loc) · 1.85 KB
/
s2i_images.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
package image_ecosystem
import "fmt"
type ImageBaseType string
type tc struct {
// The image version string (eg. '27' or '34')
Version string
// Command to execute
Cmd string
// Expected output from the command
Expected string
// Repository is either openshift/ or rhcsl/
// The default is 'openshift'
Repository string
// Internal: We resolve this in JustBeforeEach
DockerImageReference string
}
// This is a complete list of supported S2I images
var s2iImages = map[string][]tc{
"ruby": {
{
Version: "20",
Cmd: "ruby --version",
Expected: "ruby 2.0.0",
},
{
Version: "22",
Cmd: "ruby --version",
Expected: "ruby 2.2.2",
},
},
"python": {
{
Version: "27",
Cmd: "python --version",
Expected: "Python 2.7.8",
},
{
Version: "33",
Cmd: "python --version",
Expected: "Python 3.3.2",
},
},
"nodejs": {
{
Version: "010",
Cmd: "node --version",
Expected: "v0.10",
},
},
"perl": {
{
Version: "516",
Cmd: "perl --version",
Expected: "v5.16.3",
},
{
Version: "520",
Cmd: "perl --version",
Expected: "v5.20.1",
},
},
"php": {
{
Version: "55",
Cmd: "php --version",
Expected: "5.5",
},
{
Version: "56",
Cmd: "php --version",
Expected: "5.6",
},
},
}
func GetTestCaseForImages() map[string][]tc {
result := make(map[string][]tc)
for name, variants := range s2iImages {
for i := range variants {
resolveDockerImageReference(name, &variants[i])
result[name] = append(result[name], variants[i])
}
}
return result
}
// resolveDockerImageReferences resolves the pull specs for all images
func resolveDockerImageReference(name string, t *tc) {
if len(t.Repository) == 0 {
t.Repository = "openshift"
}
t.DockerImageReference = fmt.Sprintf("%s/%s-%s-centos7", t.Repository, name, t.Version)
}