From 3fada4c5e90c38518af820d4023680734e579ac7 Mon Sep 17 00:00:00 2001 From: Casey Callendrello Date: Tue, 19 Sep 2017 12:31:45 +0200 Subject: [PATCH 1/2] vendor: bump appc/spec to v0.8.11 --- Documentation/app-container.md | 4 ++-- Documentation/devel/stage1-implementors-guide.md | 2 +- Documentation/proposals/oci.md | 6 +++--- Documentation/subcommands/cat-manifest.md | 2 +- Documentation/subcommands/image.md | 2 +- Documentation/subcommands/version.md | 2 +- glide.lock | 6 +++--- glide.yaml | 2 +- stage1/aci/aci-manifest.in | 2 +- stage1_fly/aci/aci-manifest.in | 2 +- store/imagestore/store_test.go | 6 +++--- tests/empty-image/manifest | 2 +- tests/image/manifest | 2 +- tests/rkt-monitor/build-too-many-apps.sh | 2 +- tests/stub-stage1/manifest | 2 +- .../appc/spec/ace/image_manifest_main.json.in | 8 ++++---- .../appc/spec/ace/image_manifest_sidekick.json.in | 8 ++++---- vendor/github.com/appc/spec/schema/pod.go | 9 +++++++++ .../github.com/appc/spec/schema/types/environment.go | 2 +- .../appc/spec/schema/types/isolator_linux_specific.go | 10 +++++++--- vendor/github.com/appc/spec/schema/types/labels.go | 11 ++++++++--- vendor/github.com/appc/spec/schema/version.go | 2 +- 22 files changed, 56 insertions(+), 38 deletions(-) diff --git a/Documentation/app-container.md b/Documentation/app-container.md index 6e5c031b23..0236477845 100644 --- a/Documentation/app-container.md +++ b/Documentation/app-container.md @@ -35,8 +35,8 @@ To validate that `rkt` successfully implements the ACE part of the spec, use the # rkt --insecure-options=image run \ --mds-register \ --volume=database,kind=host,source=/tmp \ - https://github.com/appc/spec/releases/download/v0.8.10/ace-validator-main.aci \ - https://github.com/appc/spec/releases/download/v0.8.10/ace-validator-sidekick.aci + https://github.com/appc/spec/releases/download/v0.8.11/ace-validator-main.aci \ + https://github.com/appc/spec/releases/download/v0.8.11/ace-validator-sidekick.aci ``` [acbuild]: https://github.com/containers/build diff --git a/Documentation/devel/stage1-implementors-guide.md b/Documentation/devel/stage1-implementors-guide.md index e275cb3d9d..4ac5e11b91 100644 --- a/Documentation/devel/stage1-implementors-guide.md +++ b/Documentation/devel/stage1-implementors-guide.md @@ -253,7 +253,7 @@ If the annotation is not present, rkt assumes the version is 1. ```json { "acKind": "ImageManifest", - "acVersion": "0.8.10", + "acVersion": "0.8.11", "name": "foo.com/rkt/stage1", "labels": [ { diff --git a/Documentation/proposals/oci.md b/Documentation/proposals/oci.md index a014e2aec8..a540a37f95 100644 --- a/Documentation/proposals/oci.md +++ b/Documentation/proposals/oci.md @@ -130,9 +130,9 @@ Backwards compatibility: Currently the biggest concern identified is backwards c [docker2aci]: https://github.com/appc/docker2aci [oci-runtime]: https://github.com/opencontainers/runtime-spec -[aci]: https://github.com/appc/spec/blob/v0.8.10/spec/aci.md#app-container-image -[ace-fs]: https://github.com/appc/spec/blob/v0.8.10/spec/ace.md#filesystem-setup -[appc-image-id-type]: https://github.com/appc/spec/blob/v0.8.10/spec/types.md#image-id-type +[aci]: https://github.com/appc/spec/blob/v0.8.11/spec/aci.md#app-container-image +[ace-fs]: https://github.com/appc/spec/blob/v0.8.11/spec/ace.md#filesystem-setup +[appc-image-id-type]: https://github.com/appc/spec/blob/v0.8.11/spec/types.md#image-id-type [oci]: https://github.com/opencontainers/image-spec [oci-manifest]: https://github.com/opencontainers/image-spec/blob/v1.0.0-rc2/manifest.md#image-manifest diff --git a/Documentation/subcommands/cat-manifest.md b/Documentation/subcommands/cat-manifest.md index 282bce0c0c..95196b5874 100644 --- a/Documentation/subcommands/cat-manifest.md +++ b/Documentation/subcommands/cat-manifest.md @@ -5,7 +5,7 @@ For debugging or inspection you may want to extract the PodManifest to stdout. ``` # rkt cat-manifest UUID { - "acVersion":"0.8.10", + "acVersion":"0.8.11", "acKind":"PodManifest" ... ``` diff --git a/Documentation/subcommands/image.md b/Documentation/subcommands/image.md index 81564bac1a..aa2bb8f900 100644 --- a/Documentation/subcommands/image.md +++ b/Documentation/subcommands/image.md @@ -7,7 +7,7 @@ For debugging or inspection you may want to extract an ACI manifest to stdout. ``` # rkt image cat-manifest coreos.com/etcd { - "acVersion": "0.8.10", + "acVersion": "0.8.11", "acKind": "ImageManifest", ... ``` diff --git a/Documentation/subcommands/version.md b/Documentation/subcommands/version.md index 50a87e9cb8..e4ae3ac1a5 100644 --- a/Documentation/subcommands/version.md +++ b/Documentation/subcommands/version.md @@ -7,6 +7,6 @@ This command prints the rkt version, the appc version rkt is built against, and ``` $ rkt version rkt Version: 1.28.1 -appc Version: 0.8.10 +appc Version: 0.8.11 Go Version: go1.5.3 Go OS/Arch: linux/amd64 diff --git a/glide.lock b/glide.lock index 74f77b0c18..a2a1404be2 100644 --- a/glide.lock +++ b/glide.lock @@ -1,5 +1,5 @@ -hash: 0d70dcd3d02dde6c7f3a493536fb7629dfb18151eaef79fff15fc05439f69674 -updated: 2017-08-01T11:21:48.713539074+02:00 +hash: 5b06576039a24b5039701b611547d833429d8c94bcaf8c0c87e86a17eae97a55 +updated: 2017-09-19T12:27:26.119724281+02:00 imports: - name: github.com/appc/docker2aci version: 4537ee8e3139455eac6092d47a224d8fa19bf08a @@ -20,7 +20,7 @@ imports: subpackages: - proj2aci - name: github.com/appc/spec - version: ba99d6b8ccbbed2942e53eb5395fddae113cdf8e + version: cbe99b7160b1397bf89f9c8bb1418f69c9424049 subpackages: - ace - aci diff --git a/glide.yaml b/glide.yaml index b6bac47fba..441187181d 100644 --- a/glide.yaml +++ b/glide.yaml @@ -20,7 +20,7 @@ import: subpackages: - proj2aci - package: github.com/appc/spec - version: v0.8.10 + version: v0.8.11 subpackages: - ace - aci diff --git a/stage1/aci/aci-manifest.in b/stage1/aci/aci-manifest.in index f3842ed336..b64146a875 100644 --- a/stage1/aci/aci-manifest.in +++ b/stage1/aci/aci-manifest.in @@ -1,6 +1,6 @@ { "acKind": "ImageManifest", - "acVersion": "0.8.10", + "acVersion": "0.8.11", "name": "@RKT_STAGE1_NAME@", "labels": [ { diff --git a/stage1_fly/aci/aci-manifest.in b/stage1_fly/aci/aci-manifest.in index f3fc36b669..3cd08728f6 100644 --- a/stage1_fly/aci/aci-manifest.in +++ b/stage1_fly/aci/aci-manifest.in @@ -1,6 +1,6 @@ { "acKind": "ImageManifest", - "acVersion": "0.8.10", + "acVersion": "0.8.11", "name": "coreos.com/rkt/stage1-fly", "labels": [ { diff --git a/store/imagestore/store_test.go b/store/imagestore/store_test.go index d63b6a307d..f1f94e78bc 100644 --- a/store/imagestore/store_test.go +++ b/store/imagestore/store_test.go @@ -228,7 +228,7 @@ func TestGetAci(t *testing.T) { { `{ "acKind": "ImageManifest", - "acVersion": "0.8.10", + "acVersion": "0.8.11", "name": "example.com/test01" }`, false, @@ -236,7 +236,7 @@ func TestGetAci(t *testing.T) { { `{ "acKind": "ImageManifest", - "acVersion": "0.8.10", + "acVersion": "0.8.11", "name": "example.com/test02", "labels": [ { @@ -250,7 +250,7 @@ func TestGetAci(t *testing.T) { { `{ "acKind": "ImageManifest", - "acVersion": "0.8.10", + "acVersion": "0.8.11", "name": "example.com/test02", "labels": [ { diff --git a/tests/empty-image/manifest b/tests/empty-image/manifest index ac6eaf1727..ba501bfbc5 100644 --- a/tests/empty-image/manifest +++ b/tests/empty-image/manifest @@ -1,6 +1,6 @@ { "acKind": "ImageManifest", - "acVersion": "0.8.10", + "acVersion": "0.8.11", "name": "coreos.com/rkt-empty", "labels": [ { diff --git a/tests/image/manifest b/tests/image/manifest index 59055cfede..a871dfdd2d 100644 --- a/tests/image/manifest +++ b/tests/image/manifest @@ -1,6 +1,6 @@ { "acKind": "ImageManifest", - "acVersion": "0.8.10", + "acVersion": "0.8.11", "name": "coreos.com/rkt-inspect", "labels": [ { diff --git a/tests/rkt-monitor/build-too-many-apps.sh b/tests/rkt-monitor/build-too-many-apps.sh index e98fb5fd3c..eb6bf34876 100755 --- a/tests/rkt-monitor/build-too-many-apps.sh +++ b/tests/rkt-monitor/build-too-many-apps.sh @@ -45,7 +45,7 @@ OUTPUT=${PWD}/too-many-apps.podmanifest cat <${OUTPUT} { - "acVersion": "0.8.10", + "acVersion": "0.8.11", "acKind": "PodManifest", "apps": [ EOF diff --git a/tests/stub-stage1/manifest b/tests/stub-stage1/manifest index 8b62f48007..358074d2f8 100644 --- a/tests/stub-stage1/manifest +++ b/tests/stub-stage1/manifest @@ -1,6 +1,6 @@ { "acKind": "ImageManifest", - "acVersion": "0.8.10", + "acVersion": "0.8.11", "name": "localhost/rkt-stub-stage1", "labels": [ { diff --git a/vendor/github.com/appc/spec/ace/image_manifest_main.json.in b/vendor/github.com/appc/spec/ace/image_manifest_main.json.in index ddfc3ab2f2..13e0fd9e39 100644 --- a/vendor/github.com/appc/spec/ace/image_manifest_main.json.in +++ b/vendor/github.com/appc/spec/ace/image_manifest_main.json.in @@ -1,11 +1,11 @@ { - "acVersion": "0.8.10", + "acVersion": "0.8.11", "acKind": "ImageManifest", "name": "coreos.com/ace-validator-main", "labels": [ - { "name": "version", "value": "0.8.10" }, - { "name": "os", "value": "@GOOS@" }, - { "name": "arch", "value": "@GOARCH@" } + { "name": "version", "value": "0.8.11" }, + { "name": "os", "value": "@ACI_OS@" }, + { "name": "arch", "value": "@ACI_ARCH@" } ], "app": { "exec": [ diff --git a/vendor/github.com/appc/spec/ace/image_manifest_sidekick.json.in b/vendor/github.com/appc/spec/ace/image_manifest_sidekick.json.in index accff02f5f..74b037c469 100644 --- a/vendor/github.com/appc/spec/ace/image_manifest_sidekick.json.in +++ b/vendor/github.com/appc/spec/ace/image_manifest_sidekick.json.in @@ -1,11 +1,11 @@ { - "acVersion": "0.8.10", + "acVersion": "0.8.11", "acKind": "ImageManifest", "name": "coreos.com/ace-validator-sidekick", "labels": [ - { "name": "version", "value": "0.8.10" }, - { "name": "os", "value": "@GOOS@" }, - { "name": "arch", "value": "@GOARCH@" } + { "name": "version", "value": "0.8.11" }, + { "name": "os", "value": "@ACI_OS@" }, + { "name": "arch", "value": "@ACI_ARCH@" } ], "app": { "exec": [ diff --git a/vendor/github.com/appc/spec/schema/pod.go b/vendor/github.com/appc/spec/schema/pod.go index 9ed6c9e0a6..a834e51bdd 100644 --- a/vendor/github.com/appc/spec/schema/pod.go +++ b/vendor/github.com/appc/spec/schema/pod.go @@ -83,6 +83,15 @@ func (pm *PodManifest) assertValid() error { if pm.ACKind != PodManifestKind { return pmKindError } + + // ensure volumes names are unique (unique key) + volNames := make(map[types.ACName]bool, len(pm.Volumes)) + for _, vol := range pm.Volumes { + if volNames[vol.Name] { + return fmt.Errorf("duplicate volume name %q", vol.Name) + } + volNames[vol.Name] = true + } return nil } diff --git a/vendor/github.com/appc/spec/schema/types/environment.go b/vendor/github.com/appc/spec/schema/types/environment.go index f152a6b88d..3e7b18fade 100644 --- a/vendor/github.com/appc/spec/schema/types/environment.go +++ b/vendor/github.com/appc/spec/schema/types/environment.go @@ -21,7 +21,7 @@ import ( ) var ( - envPattern = regexp.MustCompile("^[A-Za-z_][A-Za-z_0-9]*$") + envPattern = regexp.MustCompile("^[A-Za-z_][A-Za-z_0-9.-]*$") ) type Environment []EnvironmentVariable diff --git a/vendor/github.com/appc/spec/schema/types/isolator_linux_specific.go b/vendor/github.com/appc/spec/schema/types/isolator_linux_specific.go index 3d5dc9fa28..ad3441a8dd 100644 --- a/vendor/github.com/appc/spec/schema/types/isolator_linux_specific.go +++ b/vendor/github.com/appc/spec/schema/types/isolator_linux_specific.go @@ -226,9 +226,13 @@ func (l linuxSeccompBase) AssertValid() error { if l.val.Errno == "" { return nil } - for _, c := range l.val.Errno { - if !unicode.IsUpper(c) { - return errors.New("errno must be an upper case string") + for i, c := range l.val.Errno { + if i == 0 && c != 'E' { + s := fmt.Sprintf("errno must start with an 'E' character, got %s", l.val.Errno) + return errors.New(s) + } else if !(unicode.IsUpper(c) || unicode.IsNumber(c)) { + s := fmt.Sprintf("errno can only contain upper case or numeric characters, got %s", l.val.Errno) + return errors.New(s) } } return nil diff --git a/vendor/github.com/appc/spec/schema/types/labels.go b/vendor/github.com/appc/spec/schema/types/labels.go index 89fa4285d4..25931f9402 100644 --- a/vendor/github.com/appc/spec/schema/types/labels.go +++ b/vendor/github.com/appc/spec/schema/types/labels.go @@ -28,7 +28,11 @@ var ValidOSArch = map[string][]string{ type Labels []Label -type labels Labels +type labelsSlice Labels + +func (l labelsSlice) Len() int { return len(l) } +func (l labelsSlice) Swap(i, j int) { l[i], l[j] = l[j], l[i] } +func (l labelsSlice) Less(i, j int) bool { return l[i].Name < l[j].Name } type Label struct { Name ACIdentifier `json:"name"` @@ -97,11 +101,11 @@ func (l Labels) MarshalJSON() ([]byte, error) { if err := l.assertValid(); err != nil { return nil, err } - return json.Marshal(labels(l)) + return json.Marshal(labelsSlice(l)) } func (l *Labels) UnmarshalJSON(data []byte) error { - var jl labels + var jl labelsSlice if err := json.Unmarshal(data, &jl); err != nil { return err } @@ -141,6 +145,7 @@ func LabelsFromMap(labelsMap map[ACIdentifier]string) (Labels, error) { if err := labels.assertValid(); err != nil { return nil, err } + sort.Sort(labelsSlice(labels)) return labels, nil } diff --git a/vendor/github.com/appc/spec/schema/version.go b/vendor/github.com/appc/spec/schema/version.go index 9e7265604f..2b55b7cfc7 100644 --- a/vendor/github.com/appc/spec/schema/version.go +++ b/vendor/github.com/appc/spec/schema/version.go @@ -22,7 +22,7 @@ const ( // version represents the canonical version of the appc spec and tooling. // For now, the schema and tooling is coupled with the spec itself, so // this must be kept in sync with the VERSION file in the root of the repo. - version string = "0.8.10" + version string = "0.8.11" ) var ( From a0fc3b872c3c987943d6b5ef266b8bd07cad3c5f Mon Sep 17 00:00:00 2001 From: Luca Bruno Date: Tue, 19 Sep 2017 16:28:00 +0000 Subject: [PATCH 2/2] tests/functional: skip prepared check on early failures This skips the run-prepared test if we already know prepare will fail earlier. --- tests/rkt_volume_mount_generic_test.go | 1 + tests/rkt_volume_mount_test.go | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/tests/rkt_volume_mount_generic_test.go b/tests/rkt_volume_mount_generic_test.go index adf5e62ed4..1d75007cb3 100644 --- a/tests/rkt_volume_mount_generic_test.go +++ b/tests/rkt_volume_mount_generic_test.go @@ -45,6 +45,7 @@ func TestVolumeMount(t *testing.T) { ), nil, innerFileContent, + false, }, }, }).Execute(t) diff --git a/tests/rkt_volume_mount_test.go b/tests/rkt_volume_mount_test.go index 67ff9aac71..3e918af931 100644 --- a/tests/rkt_volume_mount_test.go +++ b/tests/rkt_volume_mount_test.go @@ -103,6 +103,7 @@ type volumeMountTestCase struct { cmdArgs string podManifest *schema.PodManifest expectedResult string + skipPrepared bool } var ( @@ -121,6 +122,7 @@ var ( ), nil, innerFileContent, + false, }, { "CLI: recursive read-only mount write file must fail", @@ -136,6 +138,7 @@ var ( ), nil, "read-only file system", + false, }, } @@ -154,6 +157,7 @@ var ( ), nil, outerFileContent, + false, }, { "CLI: read-only non-recursive write file must fail", @@ -169,6 +173,7 @@ var ( ), nil, "read-only file system", + false, }, } @@ -203,6 +208,7 @@ var ( }, }, innerFileContent, + false, }, { "Write of nested file for recursive/read-only mount must fail", @@ -235,6 +241,7 @@ var ( }, }, "read-only file system", + false, }, } @@ -271,6 +278,7 @@ var ( }, }, "host:foo", + false, }, } @@ -305,6 +313,7 @@ var ( }, }, outerFileContent, + false, }, } @@ -320,6 +329,7 @@ var ( ), nil, "duplicate volume name", + true, }, } ) @@ -383,6 +393,9 @@ func NewTestVolumeMount(volumeMountTestCases [][]volumeMountTestCase) testutils. verifyHostFile(t, volDir, "file", i, tt.expectedResult) // 2. Test 'rkt prepare' + 'rkt run-prepared'. + if tt.skipPrepared { + continue + } prepareCmd := fmt.Sprintf("%s prepare", ctx.Cmd()) if manifestFile != "" { prepareCmd += fmt.Sprintf(" --pod-manifest=%s", manifestFile)