Skip to content

Commit

Permalink
Merge pull request #733 from kolyshkin/bump-gojsonschema
Browse files Browse the repository at this point in the history
Bump gojsonschema
  • Loading branch information
tianon authored Oct 25, 2021
2 parents a475b39 + 221e5ea commit 92232ab
Show file tree
Hide file tree
Showing 36 changed files with 3,066 additions and 1,187 deletions.
7 changes: 2 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,14 @@ require (
github.com/opencontainers/selinux v1.0.1-0.20190118194646-2d93b96e1a01
github.com/satori/go.uuid v1.1.0
github.com/sirupsen/logrus v1.0.2-0.20170713114250-a3f95b5c4235
github.com/stretchr/testify v1.1.5-0.20170809224252-890a5c3458b4
github.com/stretchr/testify v1.3.0
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8
github.com/urfave/cli v1.19.1
github.com/xeipuuv/gojsonschema v0.0.0-20170528113821-0c8571ac0ce1
github.com/xeipuuv/gojsonschema v1.2.0
golang.org/x/sys v0.0.0-20170407050850-f3918c30c5c2
)

require (
github.com/davecgh/go-spew v1.1.1-0.20170829195320-a47672248388 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20170225233418-6fe8760cad35 // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20150808065054-e02fc20de94c // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
)
18 changes: 10 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
github.com/blang/semver v3.5.0+incompatible h1:CGxCgetQ64DKk7rdZ++Vfnb1+ogGNnB17OJKJXD2Cfs=
github.com/blang/semver v3.5.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1-0.20170829195320-a47672248388 h1:c9n+0y02ovmvU9O/gS/fqw6HRlUwG645A2AJckmQVy0=
github.com/davecgh/go-spew v1.1.1-0.20170829195320-a47672248388/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
Expand All @@ -20,18 +21,19 @@ github.com/satori/go.uuid v1.1.0 h1:B9KXyj+GzIpJbV7gmr873NsY6zpbxNy24CBtGrk7jHo=
github.com/satori/go.uuid v1.1.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
github.com/sirupsen/logrus v1.0.2-0.20170713114250-a3f95b5c4235 h1:aPIH7fk87dLHot2nJ8bbakmAgwM4RZJtGEkwQ52pQCg=
github.com/sirupsen/logrus v1.0.2-0.20170713114250-a3f95b5c4235/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc=
github.com/stretchr/testify v1.1.5-0.20170809224252-890a5c3458b4 h1:c5DdG2to+wHgjlxcmknq5BnzaaJ0N0W842kLlOSurXc=
github.com/stretchr/testify v1.1.5-0.20170809224252-890a5c3458b4/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8 h1:zLV6q4e8Jv9EHjNg/iHfzwDkCve6Ua5jCygptrtXHvI=
github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww=
github.com/urfave/cli v1.19.1 h1:0mKm4ZoB74PxYmZVua162y1dGt1qc10MyymYRBf3lb8=
github.com/urfave/cli v1.19.1/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
github.com/xeipuuv/gojsonpointer v0.0.0-20170225233418-6fe8760cad35 h1:0TnXeVP6mx+A4CBf8cQVkQfkhyGBQCmJcT4g6zKzm7M=
github.com/xeipuuv/gojsonpointer v0.0.0-20170225233418-6fe8760cad35/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20150808065054-e02fc20de94c h1:XZWnr3bsDQWAZg4Ne+cPoXRPILrNlPNQfxBuwLl43is=
github.com/xeipuuv/gojsonreference v0.0.0-20150808065054-e02fc20de94c/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v0.0.0-20170528113821-0c8571ac0ce1 h1:p7SJSlzQ0w/wo+yjj+lnaOsAFlC0AL+t6QWkR2P7X18=
github.com/xeipuuv/gojsonschema v0.0.0-20170528113821-0c8571ac0ce1/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
golang.org/x/sys v0.0.0-20170407050850-f3918c30c5c2 h1:niKkabq6kYToDafvvFw9MeTkT4ifSvpOCRP6pFxOCZE=
golang.org/x/sys v0.0.0-20170407050850-f3918c30c5c2/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
Expand Down
5 changes: 2 additions & 3 deletions validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,8 @@ func JSONSchemaURL(version string) (url string, err error) {
if err != nil {
return "", specerror.NewError(specerror.SpecVersionInSemVer, err, rspec.Version)
}
configRenamedToConfigSchemaVersion, _ := semver.Parse("1.0.0-rc2") // config.json became config-schema.json in 1.0.0-rc2
if ver.Compare(configRenamedToConfigSchemaVersion) == -1 {
return "", fmt.Errorf("unsupported configuration version (older than %s)", configRenamedToConfigSchemaVersion)
if ver.LT(semver.Version{Major: 1, Minor: 0, Patch: 2}) {
return "", errors.New("unsupported configuration version (older than 1.0.2)")
}
return fmt.Sprintf(configSchemaTemplate, version), nil
}
Expand Down
45 changes: 19 additions & 26 deletions validate/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,33 +47,32 @@ func TestJSONSchema(t *testing.T) {
},
{
config: &rspec.Spec{
Version: "1.0.1-rc1",
Version: "1.0.99-rc1", // non-existent
},
error: "Could not read schema from HTTP, response status is 404 Not Found",
},
{
config: &rspec.Spec{
Version: "1.0.0",
Version: "1.0.0", // too old
},
error: "",
error: "1 error occurred:\n\t* unsupported configuration version (older than 1.0.2)\n\n",
},
{
config: &rspec.Spec{
Version: "1.0.0",
Process: &rspec.Process{},
Version: "1.0.2",
},
error: "1 error occurred:\n\t* args: args is required\n\n",
error: "",
},
{
config: &rspec.Spec{
Version: "1.0.0",
Version: "1.0.2",
Linux: &rspec.Linux{},
},
error: "",
},
{
config: &rspec.Spec{
Version: "1.0.0",
Version: "1.0.2",
Linux: &rspec.Linux{
RootfsPropagation: "",
},
Expand All @@ -82,7 +81,7 @@ func TestJSONSchema(t *testing.T) {
},
{
config: &rspec.Spec{
Version: "1.0.0",
Version: "1.0.2",
Linux: &rspec.Linux{
RootfsPropagation: "shared",
},
Expand All @@ -91,7 +90,7 @@ func TestJSONSchema(t *testing.T) {
},
{
config: &rspec.Spec{
Version: "1.0.0",
Version: "1.0.2",
Linux: &rspec.Linux{
RootfsPropagation: "rshared",
},
Expand All @@ -100,13 +99,7 @@ func TestJSONSchema(t *testing.T) {
},
{
config: &rspec.Spec{
Version: "1.0.0-rc5",
},
error: "process: process is required",
},
{
config: &rspec.Spec{
Version: "1.0.0",
Version: "1.0.2",
Linux: &rspec.Linux{
Namespaces: []rspec.LinuxNamespace{
{
Expand All @@ -119,7 +112,7 @@ func TestJSONSchema(t *testing.T) {
},
{
config: &rspec.Spec{
Version: "1.0.0",
Version: "1.0.2",
Linux: &rspec.Linux{
Namespaces: []rspec.LinuxNamespace{
{
Expand All @@ -132,7 +125,7 @@ func TestJSONSchema(t *testing.T) {
},
{
config: &rspec.Spec{
Version: "1.0.0",
Version: "1.0.2",
Linux: &rspec.Linux{
Seccomp: &rspec.LinuxSeccomp{
DefaultAction: "SCMP_ACT_ALLOW",
Expand All @@ -147,7 +140,7 @@ func TestJSONSchema(t *testing.T) {
},
{
config: &rspec.Spec{
Version: "1.0.0",
Version: "1.0.2",
Linux: &rspec.Linux{
Seccomp: &rspec.LinuxSeccomp{
DefaultAction: "SCMP_ACT_ALLOW",
Expand All @@ -162,7 +155,7 @@ func TestJSONSchema(t *testing.T) {
},
{
config: &rspec.Spec{
Version: "1.0.0",
Version: "1.0.2",
Linux: &rspec.Linux{
Seccomp: &rspec.LinuxSeccomp{
DefaultAction: "SCMP_ACT_ALLOW",
Expand All @@ -179,7 +172,7 @@ func TestJSONSchema(t *testing.T) {
},
{
config: &rspec.Spec{
Version: "1.0.0",
Version: "1.0.2",
Linux: &rspec.Linux{
Seccomp: &rspec.LinuxSeccomp{
DefaultAction: "SCMP_ACT_ALLOW",
Expand All @@ -192,11 +185,11 @@ func TestJSONSchema(t *testing.T) {
},
},
},
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\"",
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\"",
},
{
config: &rspec.Spec{
Version: "1.0.0",
Version: "1.0.2",
Linux: &rspec.Linux{
Seccomp: &rspec.LinuxSeccomp{
DefaultAction: "SCMP_ACT_ALLOW",
Expand All @@ -220,7 +213,7 @@ func TestJSONSchema(t *testing.T) {
},
{
config: &rspec.Spec{
Version: "1.0.0",
Version: "1.0.2",
Linux: &rspec.Linux{
Seccomp: &rspec.LinuxSeccomp{
DefaultAction: "SCMP_ACT_ALLOW",
Expand Down Expand Up @@ -322,7 +315,7 @@ func TestCheckSemVer(t *testing.T) {
expected specerror.Code
}{
{rspec.Version, specerror.NonError},
//FIXME: validate currently only handles rpsec.Version
// FIXME: validate currently only handles rpsec.Version
{"0.0.1", specerror.NonRFCError},
{"invalid", specerror.SpecVersionInSemVer},
}
Expand Down
35 changes: 17 additions & 18 deletions vendor/github.com/stretchr/testify/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 92232ab

Please sign in to comment.