Skip to content

Commit

Permalink
Add internal types for ImageStreamLayers
Browse files Browse the repository at this point in the history
  • Loading branch information
smarterclayton committed Jun 12, 2018
1 parent 8962569 commit b5b4a14
Show file tree
Hide file tree
Showing 9 changed files with 512 additions and 0 deletions.
54 changes: 54 additions & 0 deletions api/docs/apis-image.openshift.io/v1.ImageStream.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,60 @@ The server guarantees that the objects returned when using continue will be iden
* application/vnd.kubernetes.protobuf


[[Get-apis-image.openshift.io-v1-namespaces-namespace-imagestreams-name-layers]]
=== Get layers of a ImageStream in a namespace
Read layers of the specified ImageStream

==== HTTP request
----
GET /apis/image.openshift.io/v1/namespaces/$NAMESPACE/imagestreams/$NAME/layers HTTP/1.1
Authorization: Bearer $TOKEN
Accept: application/json
Connection: close
----

==== Curl request
----
$ curl -k \
-H "Authorization: Bearer $TOKEN" \
-H 'Accept: application/json' \
https://$ENDPOINT/apis/image.openshift.io/v1/namespaces/$NAMESPACE/imagestreams/$NAME/layers
----

==== Path parameters
[cols="1,5", options="header"]
|===
|Parameter|Description
|name|name of the ImageStreamLayers
|namespace|object name and auth scope, such as for teams and projects
|===

==== Query parameters
[cols="1,5", options="header"]
|===
|Parameter|Description
|pretty|If 'true', then the output is pretty printed.
|===

==== Responses
[cols="1,5", options="header"]
|===
|HTTP Code|Schema
|200 OK|v1.ImageStreamLayers
|401 Unauthorized|
|===

==== Consumes

* \*/*

==== Produces

* application/json
* application/yaml
* application/vnd.kubernetes.protobuf


[[Get-apis-image.openshift.io-v1-namespaces-namespace-imagestreams-name-secrets]]
=== Get secrets of a ImageStream in a namespace
Read secrets of the specified ImageStream
Expand Down
36 changes: 36 additions & 0 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.

138 changes: 138 additions & 0 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.

1 change: 1 addition & 0 deletions pkg/image/apis/image/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&ImageStreamTag{},
&ImageStreamTagList{},
&ImageStreamImage{},
&ImageStreamLayers{},
&ImageStreamImport{},
&kapi.SecretList{},
)
Expand Down
29 changes: 29 additions & 0 deletions pkg/image/apis/image/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,35 @@ type DockerImageReference struct {
ID string
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// ImageStreamLayers describes information about the layers referenced by images in this
// image stream.
type ImageStreamLayers struct {
metav1.TypeMeta
// Standard object's metadata.
metav1.ObjectMeta
// blobs is a map of blob name to metadata about the blob.
Blobs map[string]ImageLayerData
// layers is a map between an image name and the names of the blobs that form the
// images.
Layers map[string]BlobReferences
// manifests is a map between an image name and the name of the manifest blob, if one
// exists.
Manifests map[string]string
}

// BlobReferences is an array of names of blobs.
type BlobReferences []string

// ImageLayerData contains metadata about an image layer.
type ImageLayerData struct {
// Size of the layer in bytes as defined by the underlying store.
LayerSize int64
// MediaType of the referenced object.
MediaType string
}

// +genclient
// +genclient:onlyVerbs=create
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
Loading

0 comments on commit b5b4a14

Please sign in to comment.