From 405b912f7efa2d71a8b836db3671950ffbc3c557 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Wed, 24 May 2017 16:10:09 +0200 Subject: [PATCH] update image-spec to v1.0.0-rc6 Signed-off-by: Antonio Murdaca --- vendor.conf | 2 +- .../containers/image/oci/layout/oci_dest.go | 16 +++-- .../containers/image/oci/layout/oci_src.go | 2 +- .../image/oci/layout/oci_transport.go | 12 ++-- .../opencontainers/image-spec/README.md | 18 ++---- .../image-spec/specs-go/v1/config.go | 17 +++-- .../image-spec/specs-go/v1/descriptor.go | 30 ++++++++- .../image-spec/specs-go/v1/image_index.go | 63 ------------------- .../image-spec/specs-go/v1/index.go | 29 +++++++++ .../image-spec/specs-go/v1/manifest.go | 2 +- .../image-spec/specs-go/v1/mediatype.go | 3 + .../image-spec/specs-go/version.go | 2 +- 12 files changed, 95 insertions(+), 101 deletions(-) delete mode 100644 vendor/github.com/opencontainers/image-spec/specs-go/v1/image_index.go create mode 100644 vendor/github.com/opencontainers/image-spec/specs-go/v1/index.go diff --git a/vendor.conf b/vendor.conf index 16fb0aa8..eec577a0 100644 --- a/vendor.conf +++ b/vendor.conf @@ -23,7 +23,7 @@ golang.org/x/text master github.com/docker/distribution master github.com/docker/libtrust master github.com/opencontainers/runc master -github.com/opencontainers/image-spec v1.0.0-rc5 +github.com/opencontainers/image-spec v1.0.0-rc6 # -- start OCI image validation requirements. github.com/opencontainers/runtime-spec v1.0.0-rc4 github.com/opencontainers/image-tools v0.1.0 diff --git a/vendor/github.com/containers/image/oci/layout/oci_dest.go b/vendor/github.com/containers/image/oci/layout/oci_dest.go index d2a44b22..3d891b40 100644 --- a/vendor/github.com/containers/image/oci/layout/oci_dest.go +++ b/vendor/github.com/containers/image/oci/layout/oci_dest.go @@ -19,12 +19,12 @@ import ( type ociImageDestination struct { ref ociReference - index imgspecv1.ImageIndex + index imgspecv1.Index } // newImageDestination returns an ImageDestination for writing to an existing directory. func newImageDestination(ref ociReference) types.ImageDestination { - index := imgspecv1.ImageIndex{ + index := imgspecv1.Index{ Versioned: imgspec.Versioned{ SchemaVersion: 2, }, @@ -175,13 +175,11 @@ func (d *ociImageDestination) PutManifest(m []byte) error { annotations := make(map[string]string) annotations["org.opencontainers.ref.name"] = d.ref.tag desc.Annotations = annotations - d.index.Manifests = append(d.index.Manifests, imgspecv1.ManifestDescriptor{ - Descriptor: desc, - Platform: imgspecv1.Platform{ - Architecture: runtime.GOARCH, - OS: runtime.GOOS, - }, - }) + desc.Platform = &imgspecv1.Platform{ + Architecture: runtime.GOARCH, + OS: runtime.GOOS, + } + d.index.Manifests = append(d.index.Manifests, desc) return nil } diff --git a/vendor/github.com/containers/image/oci/layout/oci_src.go b/vendor/github.com/containers/image/oci/layout/oci_src.go index 04eca3f0..42556eea 100644 --- a/vendor/github.com/containers/image/oci/layout/oci_src.go +++ b/vendor/github.com/containers/image/oci/layout/oci_src.go @@ -12,7 +12,7 @@ import ( type ociImageSource struct { ref ociReference - descriptor imgspecv1.ManifestDescriptor + descriptor imgspecv1.Descriptor } // newImageSource returns an ImageSource for reading from an existing directory. diff --git a/vendor/github.com/containers/image/oci/layout/oci_transport.go b/vendor/github.com/containers/image/oci/layout/oci_transport.go index b020aebc..440a662a 100644 --- a/vendor/github.com/containers/image/oci/layout/oci_transport.go +++ b/vendor/github.com/containers/image/oci/layout/oci_transport.go @@ -186,17 +186,17 @@ func (ref ociReference) NewImage(ctx *types.SystemContext) (types.Image, error) return image.FromSource(src) } -func (ref ociReference) getManifestDescriptor() (imgspecv1.ManifestDescriptor, error) { +func (ref ociReference) getManifestDescriptor() (imgspecv1.Descriptor, error) { indexJSON, err := os.Open(ref.indexPath()) if err != nil { - return imgspecv1.ManifestDescriptor{}, err + return imgspecv1.Descriptor{}, err } defer indexJSON.Close() - index := imgspecv1.ImageIndex{} + index := imgspecv1.Index{} if err := json.NewDecoder(indexJSON).Decode(&index); err != nil { - return imgspecv1.ManifestDescriptor{}, err + return imgspecv1.Descriptor{}, err } - var d *imgspecv1.ManifestDescriptor + var d *imgspecv1.Descriptor for _, md := range index.Manifests { if md.MediaType != imgspecv1.MediaTypeImageManifest { continue @@ -211,7 +211,7 @@ func (ref ociReference) getManifestDescriptor() (imgspecv1.ManifestDescriptor, e } } if d == nil { - return imgspecv1.ManifestDescriptor{}, fmt.Errorf("no descriptor found for reference %q", ref.tag) + return imgspecv1.Descriptor{}, fmt.Errorf("no descriptor found for reference %q", ref.tag) } return *d, nil } diff --git a/vendor/github.com/opencontainers/image-spec/README.md b/vendor/github.com/opencontainers/image-spec/README.md index c63d8b72..5ab5554e 100644 --- a/vendor/github.com/opencontainers/image-spec/README.md +++ b/vendor/github.com/opencontainers/image-spec/README.md @@ -7,7 +7,7 @@ The OCI Image Format project creates and maintains the software shipping container image format spec (OCI Image Format). -The specification can be found [here](spec.md). +**[The specification can be found here](spec.md).** This repository also provides [Go types](specs-go), [intra-blob validation tooling, and JSON Schema](schema). The Go types and validation should be compatible with the current Go release; earlier Go releases are not supported. @@ -42,22 +42,13 @@ To support this UX the OCI Image Format contains sufficient information to launc A: Distribution, for example using HTTP as both Docker v2.2 and AppC do today, is currently out of scope on the [OCI Scope Table](https://www.opencontainers.org/about/oci-scope-table). There has been [some discussion on the TOB mailing list](https://groups.google.com/a/opencontainers.org/d/msg/tob/A3JnmI-D-6Y/tLuptPDHAgAJ) to make distribution an optional layer, but this topic is a work in progress. -**Q: Why a new project?** - -A: The [first OCI spec](https://github.com/opencontainers/runtime-spec) centered around defining the run side of a container. -This is generally seen to be an orthogonal concern to the shipping container component. -As practical examples of this separation you see many organizations separating these concerns into different teams and organizations: the Docker Distribution project and the Docker containerd project; Amazon ECS and Amazon EC2 Container Registry, etc. - -**Q: Why work on this?** - -A: We are seeing many independent implementations of container image handling including build systems, registries, and image analysis tools. -As an organization we would like to encourage this growth and bring people together to ensure a technically correct and open specification continues to evolve reflecting the OCI values. - **Q: What happens to AppC or Docker Image Formats?** A: Existing formats can continue to be a proving ground for technologies, as needed. The OCI Image Format project strives to provide a dependable open specification that can be shared between different tools and be evolved for years or decades of compatibility; as the deb and rpm format have. +Find more [FAQ on the OCI site](https://www.opencontainers.org/faq). + ## Roadmap The [GitHub milestones](https://github.com/opencontainers/image-spec/milestones) lay out the path to the OCI v1.0.0 release in late 2016. @@ -85,7 +76,7 @@ When in doubt, start on the [mailing-list](#mailing-list). The contributors and maintainers of all OCI projects have a weekly meeting Wednesdays at 2:00 PM (USA Pacific). Everyone is welcome to participate via [UberConference web][UberConference] or audio-only: +1-415-968-0849 (no PIN needed). An initial agenda will be posted to the [mailing list](#mailing-list) earlier in the week, and everyone is welcome to propose additional topics or suggest other agenda alterations there. -Minutes are posted to the [mailing list](#mailing-list) and minutes from past calls are archived to the [wiki](https://github.com/opencontainers/runtime-spec/wiki) for those who are unable to join the call. +Minutes are posted to the [mailing list](#mailing-list) and minutes from past calls are archived [here][minutes]. ## Mailing List @@ -173,3 +164,4 @@ Read more on [How to Write a Git Commit Message](http://chris.beams.io/posts/git [UberConference]: https://www.uberconference.com/opencontainers [irc-logs]: http://ircbot.wl.linuxfoundation.org/eavesdrop/%23opencontainers/ +[minutes]: http://ircbot.wl.linuxfoundation.org/meetings/opencontainers/ diff --git a/vendor/github.com/opencontainers/image-spec/specs-go/v1/config.go b/vendor/github.com/opencontainers/image-spec/specs-go/v1/config.go index ddbc5862..8475ff74 100644 --- a/vendor/github.com/opencontainers/image-spec/specs-go/v1/config.go +++ b/vendor/github.com/opencontainers/image-spec/specs-go/v1/config.go @@ -14,7 +14,11 @@ package v1 -import "time" +import ( + "time" + + digest "github.com/opencontainers/go-digest" +) // ImageConfig defines the execution parameters which should be used as a base when running a container using an image. type ImageConfig struct { @@ -40,7 +44,10 @@ type ImageConfig struct { WorkingDir string `json:"WorkingDir,omitempty"` // Labels contains arbitrary metadata for the container. - Labels map[string]string `json:"labels,omitempty"` + Labels map[string]string `json:"Labels,omitempty"` + + // StopSignal contains the system call signal that will be sent to the container to exit. + StopSignal string `json:"StopSignal,omitempty"` } // RootFS describes a layer content addresses @@ -49,13 +56,13 @@ type RootFS struct { Type string `json:"type"` // DiffIDs is an array of layer content hashes (DiffIDs), in order from bottom-most to top-most. - DiffIDs []string `json:"diff_ids"` + DiffIDs []digest.Digest `json:"diff_ids"` } // History describes the history of a layer. type History struct { // Created is the combined date and time at which the layer was created, formatted as defined by RFC 3339, section 5.6. - Created time.Time `json:"created,omitempty"` + Created *time.Time `json:"created,omitempty"` // CreatedBy is the command which created the layer. CreatedBy string `json:"created_by,omitempty"` @@ -74,7 +81,7 @@ type History struct { // This provides the `application/vnd.oci.image.config.v1+json` mediatype when marshalled to JSON. type Image struct { // Created is the combined date and time at which the image was created, formatted as defined by RFC 3339, section 5.6. - Created time.Time `json:"created,omitempty"` + Created *time.Time `json:"created,omitempty"` // Author defines the name and/or email address of the person or entity which created and is responsible for maintaining the image. Author string `json:"author,omitempty"` diff --git a/vendor/github.com/opencontainers/image-spec/specs-go/v1/descriptor.go b/vendor/github.com/opencontainers/image-spec/specs-go/v1/descriptor.go index fdf50c74..6e442a08 100644 --- a/vendor/github.com/opencontainers/image-spec/specs-go/v1/descriptor.go +++ b/vendor/github.com/opencontainers/image-spec/specs-go/v1/descriptor.go @@ -17,7 +17,8 @@ package v1 import digest "github.com/opencontainers/go-digest" // Descriptor describes the disposition of targeted content. -// This structure provides `application/vnd.oci.descriptor.v1+json` mediatype when marshalled to JSON +// This structure provides `application/vnd.oci.descriptor.v1+json` mediatype +// when marshalled to JSON. type Descriptor struct { // MediaType is the media type of the object this schema refers to. MediaType string `json:"mediaType,omitempty"` @@ -33,4 +34,31 @@ type Descriptor struct { // Annotations contains arbitrary metadata relating to the targeted content. Annotations map[string]string `json:"annotations,omitempty"` + + // Platform describes the platform which the image in the manifest runs on. + // + // This should only be used when referring to a manifest. + Platform *Platform `json:"platform,omitempty"` +} + +// Platform describes the platform which the image in the manifest runs on. +type Platform struct { + // Architecture field specifies the CPU architecture, for example + // `amd64` or `ppc64`. + Architecture string `json:"architecture"` + + // OS specifies the operating system, for example `linux` or `windows`. + OS string `json:"os"` + + // OSVersion is an optional field specifying the operating system + // version, for example on Windows `10.0.14393.1066`. + OSVersion string `json:"os.version,omitempty"` + + // OSFeatures is an optional field specifying an array of strings, + // each listing a required OS feature (for example on Windows `win32k`). + OSFeatures []string `json:"os.features,omitempty"` + + // Variant is an optional field specifying a variant of the CPU, for + // example `v7` to specify ARMv7 when architecture is `arm`. + Variant string `json:"variant,omitempty"` } diff --git a/vendor/github.com/opencontainers/image-spec/specs-go/v1/image_index.go b/vendor/github.com/opencontainers/image-spec/specs-go/v1/image_index.go deleted file mode 100644 index 3c1b6b17..00000000 --- a/vendor/github.com/opencontainers/image-spec/specs-go/v1/image_index.go +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2016 The Linux Foundation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package v1 - -import "github.com/opencontainers/image-spec/specs-go" - -// Platform describes the platform which the image in the manifest runs on. -type Platform struct { - // Architecture field specifies the CPU architecture, for example - // `amd64` or `ppc64`. - Architecture string `json:"architecture"` - - // OS specifies the operating system, for example `linux` or `windows`. - OS string `json:"os"` - - // OSVersion is an optional field specifying the operating system - // version, for example `10.0.10586`. - OSVersion string `json:"os.version,omitempty"` - - // OSFeatures is an optional field specifying an array of strings, - // each listing a required OS feature (for example on Windows `win32k`). - OSFeatures []string `json:"os.features,omitempty"` - - // Variant is an optional field specifying a variant of the CPU, for - // example `ppc64le` to specify a little-endian version of a PowerPC CPU. - Variant string `json:"variant,omitempty"` - - // Features is an optional field specifying an array of strings, each - // listing a required CPU feature (for example `sse4` or `aes`). - Features []string `json:"features,omitempty"` -} - -// ManifestDescriptor describes a platform specific manifest. -type ManifestDescriptor struct { - Descriptor - - // Platform describes the platform which the image in the manifest runs on. - Platform Platform `json:"platform"` -} - -// ImageIndex references manifests for various platforms. -// This structure provides `application/vnd.oci.image.index.v1+json` mediatype when marshalled to JSON. -type ImageIndex struct { - specs.Versioned - - // Manifests references platform specific manifests. - Manifests []ManifestDescriptor `json:"manifests"` - - // Annotations contains arbitrary metadata for the image index. - Annotations map[string]string `json:"annotations,omitempty"` -} diff --git a/vendor/github.com/opencontainers/image-spec/specs-go/v1/index.go b/vendor/github.com/opencontainers/image-spec/specs-go/v1/index.go new file mode 100644 index 00000000..4e6c4b23 --- /dev/null +++ b/vendor/github.com/opencontainers/image-spec/specs-go/v1/index.go @@ -0,0 +1,29 @@ +// Copyright 2016 The Linux Foundation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package v1 + +import "github.com/opencontainers/image-spec/specs-go" + +// Index references manifests for various platforms. +// This structure provides `application/vnd.oci.image.index.v1+json` mediatype when marshalled to JSON. +type Index struct { + specs.Versioned + + // Manifests references platform specific manifests. + Manifests []Descriptor `json:"manifests"` + + // Annotations contains arbitrary metadata for the image index. + Annotations map[string]string `json:"annotations,omitempty"` +} diff --git a/vendor/github.com/opencontainers/image-spec/specs-go/v1/manifest.go b/vendor/github.com/opencontainers/image-spec/specs-go/v1/manifest.go index 42d8c6a2..7ff32c40 100644 --- a/vendor/github.com/opencontainers/image-spec/specs-go/v1/manifest.go +++ b/vendor/github.com/opencontainers/image-spec/specs-go/v1/manifest.go @@ -27,6 +27,6 @@ type Manifest struct { // Layers is an indexed list of layers referenced by the manifest. Layers []Descriptor `json:"layers"` - // Annotations contains arbitrary metadata for the manifest. + // Annotations contains arbitrary metadata for the image manifest. Annotations map[string]string `json:"annotations,omitempty"` } diff --git a/vendor/github.com/opencontainers/image-spec/specs-go/v1/mediatype.go b/vendor/github.com/opencontainers/image-spec/specs-go/v1/mediatype.go index c3f2e8ab..bad7bb97 100644 --- a/vendor/github.com/opencontainers/image-spec/specs-go/v1/mediatype.go +++ b/vendor/github.com/opencontainers/image-spec/specs-go/v1/mediatype.go @@ -18,6 +18,9 @@ const ( // MediaTypeDescriptor specifies the media type for a content descriptor. MediaTypeDescriptor = "application/vnd.oci.descriptor.v1+json" + // MediaTypeLayoutHeader specifies the media type for the oci-layout. + MediaTypeLayoutHeader = "application/vnd.oci.layout.header.v1+json" + // MediaTypeImageManifest specifies the media type for an image manifest. MediaTypeImageManifest = "application/vnd.oci.image.manifest.v1+json" diff --git a/vendor/github.com/opencontainers/image-spec/specs-go/version.go b/vendor/github.com/opencontainers/image-spec/specs-go/version.go index 44babdfe..f4cda6ed 100644 --- a/vendor/github.com/opencontainers/image-spec/specs-go/version.go +++ b/vendor/github.com/opencontainers/image-spec/specs-go/version.go @@ -25,7 +25,7 @@ const ( VersionPatch = 0 // VersionDev indicates development branch. Releases will be empty string. - VersionDev = "-rc5" + VersionDev = "-rc6-dev" ) // Version is the specification version that the package types support.