Skip to content

Commit 92232ab

Browse files
authored
Merge pull request #733 from kolyshkin/bump-gojsonschema
Bump gojsonschema
2 parents a475b39 + 221e5ea commit 92232ab

36 files changed

+3066
-1187
lines changed

go.mod

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@ require (
1111
github.com/opencontainers/selinux v1.0.1-0.20190118194646-2d93b96e1a01
1212
github.com/satori/go.uuid v1.1.0
1313
github.com/sirupsen/logrus v1.0.2-0.20170713114250-a3f95b5c4235
14-
github.com/stretchr/testify v1.1.5-0.20170809224252-890a5c3458b4
14+
github.com/stretchr/testify v1.3.0
1515
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8
1616
github.com/urfave/cli v1.19.1
17-
github.com/xeipuuv/gojsonschema v0.0.0-20170528113821-0c8571ac0ce1
17+
github.com/xeipuuv/gojsonschema v1.2.0
1818
golang.org/x/sys v0.0.0-20170407050850-f3918c30c5c2
1919
)
2020

2121
require (
2222
github.com/davecgh/go-spew v1.1.1-0.20170829195320-a47672248388 // indirect
23-
github.com/pmezard/go-difflib v1.0.0 // indirect
24-
github.com/xeipuuv/gojsonpointer v0.0.0-20170225233418-6fe8760cad35 // indirect
25-
github.com/xeipuuv/gojsonreference v0.0.0-20150808065054-e02fc20de94c // indirect
2623
gopkg.in/yaml.v2 v2.4.0 // indirect
2724
)

go.sum

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
github.com/blang/semver v3.5.0+incompatible h1:CGxCgetQ64DKk7rdZ++Vfnb1+ogGNnB17OJKJXD2Cfs=
22
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
3+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
34
github.com/davecgh/go-spew v1.1.1-0.20170829195320-a47672248388 h1:c9n+0y02ovmvU9O/gS/fqw6HRlUwG645A2AJckmQVy0=
45
github.com/davecgh/go-spew v1.1.1-0.20170829195320-a47672248388/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
56
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
@@ -20,18 +21,19 @@ github.com/satori/go.uuid v1.1.0 h1:B9KXyj+GzIpJbV7gmr873NsY6zpbxNy24CBtGrk7jHo=
2021
github.com/satori/go.uuid v1.1.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
2122
github.com/sirupsen/logrus v1.0.2-0.20170713114250-a3f95b5c4235 h1:aPIH7fk87dLHot2nJ8bbakmAgwM4RZJtGEkwQ52pQCg=
2223
github.com/sirupsen/logrus v1.0.2-0.20170713114250-a3f95b5c4235/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
23-
github.com/stretchr/testify v1.1.5-0.20170809224252-890a5c3458b4 h1:c5DdG2to+wHgjlxcmknq5BnzaaJ0N0W842kLlOSurXc=
24-
github.com/stretchr/testify v1.1.5-0.20170809224252-890a5c3458b4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
24+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
25+
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
26+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
2527
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8 h1:zLV6q4e8Jv9EHjNg/iHfzwDkCve6Ua5jCygptrtXHvI=
2628
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
2729
github.com/urfave/cli v1.19.1 h1:0mKm4ZoB74PxYmZVua162y1dGt1qc10MyymYRBf3lb8=
2830
github.com/urfave/cli v1.19.1/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
29-
github.com/xeipuuv/gojsonpointer v0.0.0-20170225233418-6fe8760cad35 h1:0TnXeVP6mx+A4CBf8cQVkQfkhyGBQCmJcT4g6zKzm7M=
30-
github.com/xeipuuv/gojsonpointer v0.0.0-20170225233418-6fe8760cad35/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
31-
github.com/xeipuuv/gojsonreference v0.0.0-20150808065054-e02fc20de94c h1:XZWnr3bsDQWAZg4Ne+cPoXRPILrNlPNQfxBuwLl43is=
32-
github.com/xeipuuv/gojsonreference v0.0.0-20150808065054-e02fc20de94c/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
33-
github.com/xeipuuv/gojsonschema v0.0.0-20170528113821-0c8571ac0ce1 h1:p7SJSlzQ0w/wo+yjj+lnaOsAFlC0AL+t6QWkR2P7X18=
34-
github.com/xeipuuv/gojsonschema v0.0.0-20170528113821-0c8571ac0ce1/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
31+
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
32+
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
33+
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
34+
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
35+
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
36+
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
3537
golang.org/x/sys v0.0.0-20170407050850-f3918c30c5c2 h1:niKkabq6kYToDafvvFw9MeTkT4ifSvpOCRP6pFxOCZE=
3638
golang.org/x/sys v0.0.0-20170407050850-f3918c30c5c2/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
3739
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=

validate/validate.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,8 @@ func JSONSchemaURL(version string) (url string, err error) {
131131
if err != nil {
132132
return "", specerror.NewError(specerror.SpecVersionInSemVer, err, rspec.Version)
133133
}
134-
configRenamedToConfigSchemaVersion, _ := semver.Parse("1.0.0-rc2") // config.json became config-schema.json in 1.0.0-rc2
135-
if ver.Compare(configRenamedToConfigSchemaVersion) == -1 {
136-
return "", fmt.Errorf("unsupported configuration version (older than %s)", configRenamedToConfigSchemaVersion)
134+
if ver.LT(semver.Version{Major: 1, Minor: 0, Patch: 2}) {
135+
return "", errors.New("unsupported configuration version (older than 1.0.2)")
137136
}
138137
return fmt.Sprintf(configSchemaTemplate, version), nil
139138
}

validate/validate_test.go

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -47,33 +47,32 @@ func TestJSONSchema(t *testing.T) {
4747
},
4848
{
4949
config: &rspec.Spec{
50-
Version: "1.0.1-rc1",
50+
Version: "1.0.99-rc1", // non-existent
5151
},
5252
error: "Could not read schema from HTTP, response status is 404 Not Found",
5353
},
5454
{
5555
config: &rspec.Spec{
56-
Version: "1.0.0",
56+
Version: "1.0.0", // too old
5757
},
58-
error: "",
58+
error: "1 error occurred:\n\t* unsupported configuration version (older than 1.0.2)\n\n",
5959
},
6060
{
6161
config: &rspec.Spec{
62-
Version: "1.0.0",
63-
Process: &rspec.Process{},
62+
Version: "1.0.2",
6463
},
65-
error: "1 error occurred:\n\t* args: args is required\n\n",
64+
error: "",
6665
},
6766
{
6867
config: &rspec.Spec{
69-
Version: "1.0.0",
68+
Version: "1.0.2",
7069
Linux: &rspec.Linux{},
7170
},
7271
error: "",
7372
},
7473
{
7574
config: &rspec.Spec{
76-
Version: "1.0.0",
75+
Version: "1.0.2",
7776
Linux: &rspec.Linux{
7877
RootfsPropagation: "",
7978
},
@@ -82,7 +81,7 @@ func TestJSONSchema(t *testing.T) {
8281
},
8382
{
8483
config: &rspec.Spec{
85-
Version: "1.0.0",
84+
Version: "1.0.2",
8685
Linux: &rspec.Linux{
8786
RootfsPropagation: "shared",
8887
},
@@ -91,7 +90,7 @@ func TestJSONSchema(t *testing.T) {
9190
},
9291
{
9392
config: &rspec.Spec{
94-
Version: "1.0.0",
93+
Version: "1.0.2",
9594
Linux: &rspec.Linux{
9695
RootfsPropagation: "rshared",
9796
},
@@ -100,13 +99,7 @@ func TestJSONSchema(t *testing.T) {
10099
},
101100
{
102101
config: &rspec.Spec{
103-
Version: "1.0.0-rc5",
104-
},
105-
error: "process: process is required",
106-
},
107-
{
108-
config: &rspec.Spec{
109-
Version: "1.0.0",
102+
Version: "1.0.2",
110103
Linux: &rspec.Linux{
111104
Namespaces: []rspec.LinuxNamespace{
112105
{
@@ -119,7 +112,7 @@ func TestJSONSchema(t *testing.T) {
119112
},
120113
{
121114
config: &rspec.Spec{
122-
Version: "1.0.0",
115+
Version: "1.0.2",
123116
Linux: &rspec.Linux{
124117
Namespaces: []rspec.LinuxNamespace{
125118
{
@@ -132,7 +125,7 @@ func TestJSONSchema(t *testing.T) {
132125
},
133126
{
134127
config: &rspec.Spec{
135-
Version: "1.0.0",
128+
Version: "1.0.2",
136129
Linux: &rspec.Linux{
137130
Seccomp: &rspec.LinuxSeccomp{
138131
DefaultAction: "SCMP_ACT_ALLOW",
@@ -147,7 +140,7 @@ func TestJSONSchema(t *testing.T) {
147140
},
148141
{
149142
config: &rspec.Spec{
150-
Version: "1.0.0",
143+
Version: "1.0.2",
151144
Linux: &rspec.Linux{
152145
Seccomp: &rspec.LinuxSeccomp{
153146
DefaultAction: "SCMP_ACT_ALLOW",
@@ -162,7 +155,7 @@ func TestJSONSchema(t *testing.T) {
162155
},
163156
{
164157
config: &rspec.Spec{
165-
Version: "1.0.0",
158+
Version: "1.0.2",
166159
Linux: &rspec.Linux{
167160
Seccomp: &rspec.LinuxSeccomp{
168161
DefaultAction: "SCMP_ACT_ALLOW",
@@ -179,7 +172,7 @@ func TestJSONSchema(t *testing.T) {
179172
},
180173
{
181174
config: &rspec.Spec{
182-
Version: "1.0.0",
175+
Version: "1.0.2",
183176
Linux: &rspec.Linux{
184177
Seccomp: &rspec.LinuxSeccomp{
185178
DefaultAction: "SCMP_ACT_ALLOW",
@@ -192,11 +185,11 @@ func TestJSONSchema(t *testing.T) {
192185
},
193186
},
194187
},
195-
error: "linux.seccomp.syscalls.0.action: linux.seccomp.syscalls.0.action must be one of the following: \"SCMP_ACT_KILL\", \"SCMP_ACT_TRAP\", \"SCMP_ACT_ERRNO\", \"SCMP_ACT_TRACE\", \"SCMP_ACT_ALLOW\"",
188+
error: "linux.seccomp.syscalls.0.action: linux.seccomp.syscalls.0.action must be one of the following: \"SCMP_ACT_KILL\", \"SCMP_ACT_TRAP\", \"SCMP_ACT_ERRNO\", \"SCMP_ACT_TRACE\", \"SCMP_ACT_ALLOW\", \"SCMP_ACT_LOG\"",
196189
},
197190
{
198191
config: &rspec.Spec{
199-
Version: "1.0.0",
192+
Version: "1.0.2",
200193
Linux: &rspec.Linux{
201194
Seccomp: &rspec.LinuxSeccomp{
202195
DefaultAction: "SCMP_ACT_ALLOW",
@@ -220,7 +213,7 @@ func TestJSONSchema(t *testing.T) {
220213
},
221214
{
222215
config: &rspec.Spec{
223-
Version: "1.0.0",
216+
Version: "1.0.2",
224217
Linux: &rspec.Linux{
225218
Seccomp: &rspec.LinuxSeccomp{
226219
DefaultAction: "SCMP_ACT_ALLOW",
@@ -322,7 +315,7 @@ func TestCheckSemVer(t *testing.T) {
322315
expected specerror.Code
323316
}{
324317
{rspec.Version, specerror.NonError},
325-
//FIXME: validate currently only handles rpsec.Version
318+
// FIXME: validate currently only handles rpsec.Version
326319
{"0.0.1", specerror.NonRFCError},
327320
{"invalid", specerror.SpecVersionInSemVer},
328321
}

vendor/github.com/stretchr/testify/LICENSE

Lines changed: 17 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)