Skip to content

Commit

Permalink
Update openshift image layers API
Browse files Browse the repository at this point in the history
  • Loading branch information
smarterclayton committed Aug 14, 2018
1 parent 96c75d7 commit 794d7bc
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 22 deletions.
15 changes: 11 additions & 4 deletions api/protobuf-spec/github_com_openshift_api_image_v1.proto

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

14 changes: 9 additions & 5 deletions api/swagger-spec/openshift-openapi-spec.json

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

10 changes: 8 additions & 2 deletions pkg/image/apis/image/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,15 +486,21 @@ type ImageStreamLayers struct {

// ImageBlobReferences describes the blob references within an image.
type ImageBlobReferences struct {
// imageMissing is true if the image is referenced by the image stream but the image
// object has been deleted from the API by an administrator. When this field is set,
// layers and config fields may be empty and callers that depend on the image metadata
// should consider the image to be unavailable for download or viewing.
// +optional
ImageMissing bool
// layers is the list of blobs that compose this image, from base layer to top layer.
// All layers referenced by this array will be defined in the blobs map. Some images
// may have zero layers.
// +optional
Layers []string
// manifest, if set, is the blob that contains the image manifest. Some images do
// config, if set, is the blob that contains the image configuration. Some images do
// not have separate manifest blobs and this field will be set to nil if so.
// +optional
Manifest *string
Config *string
}

// ImageLayerData contains metadata about an image layer.
Expand Down
6 changes: 4 additions & 2 deletions pkg/image/apis/image/v1/zz_generated.conversion.go

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

4 changes: 2 additions & 2 deletions pkg/image/apis/image/zz_generated.deepcopy.go

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

2 changes: 1 addition & 1 deletion pkg/image/apiserver/registry/imagestream/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ func addImageStreamLayersFromCache(isl *imageapi.ImageStreamLayers, is *imageapi
}

if blob := entry.Config; blob != nil {
reference.Manifest = &blob.Name
reference.Config = &blob.Name
if _, ok := isl.Blobs[blob.Name]; !ok {
if blob.LayerSize == 0 {
// only send media type since we don't the size of the manifest
Expand Down
13 changes: 10 additions & 3 deletions pkg/openapi/zz_generated.openapi.go

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

6 changes: 3 additions & 3 deletions test/extended/images/layers.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ var _ = g.Describe("[Feature:ImageLayers] Image layer subresource", func() {
l, ok := layers.Images[image.Image.Name]
o.Expect(ok).To(o.BeTrue())
o.Expect(len(l.Layers)).To(o.BeNumerically(">", 0))
o.Expect(l.Manifest).ToNot(o.BeNil())
o.Expect(layers.Blobs[*l.Manifest]).ToNot(o.BeNil())
o.Expect(layers.Blobs[*l.Manifest].MediaType).To(o.Equal("application/vnd.docker.container.image.v1+json"))
o.Expect(l.Config).ToNot(o.BeNil())
o.Expect(layers.Blobs[*l.Config]).ToNot(o.BeNil())
o.Expect(layers.Blobs[*l.Config].MediaType).To(o.Equal("application/vnd.docker.container.image.v1+json"))
for _, layerID := range l.Layers {
o.Expect(layers.Blobs).To(o.HaveKey(layerID))
o.Expect(layers.Blobs[layerID].MediaType).NotTo(o.BeEmpty())
Expand Down

0 comments on commit 794d7bc

Please sign in to comment.