Skip to content

Commit b5b4a14

Browse files
Add internal types for ImageStreamLayers
1 parent 8962569 commit b5b4a14

File tree

9 files changed

+512
-0
lines changed

9 files changed

+512
-0
lines changed

api/docs/apis-image.openshift.io/v1.ImageStream.adoc

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,60 @@ The server guarantees that the objects returned when using continue will be iden
950950
* application/vnd.kubernetes.protobuf
951951

952952

953+
[[Get-apis-image.openshift.io-v1-namespaces-namespace-imagestreams-name-layers]]
954+
=== Get layers of a ImageStream in a namespace
955+
Read layers of the specified ImageStream
956+
957+
==== HTTP request
958+
----
959+
GET /apis/image.openshift.io/v1/namespaces/$NAMESPACE/imagestreams/$NAME/layers HTTP/1.1
960+
Authorization: Bearer $TOKEN
961+
Accept: application/json
962+
Connection: close
963+
----
964+
965+
==== Curl request
966+
----
967+
$ curl -k \
968+
-H "Authorization: Bearer $TOKEN" \
969+
-H 'Accept: application/json' \
970+
https://$ENDPOINT/apis/image.openshift.io/v1/namespaces/$NAMESPACE/imagestreams/$NAME/layers
971+
----
972+
973+
==== Path parameters
974+
[cols="1,5", options="header"]
975+
|===
976+
|Parameter|Description
977+
|name|name of the ImageStreamLayers
978+
|namespace|object name and auth scope, such as for teams and projects
979+
|===
980+
981+
==== Query parameters
982+
[cols="1,5", options="header"]
983+
|===
984+
|Parameter|Description
985+
|pretty|If 'true', then the output is pretty printed.
986+
|===
987+
988+
==== Responses
989+
[cols="1,5", options="header"]
990+
|===
991+
|HTTP Code|Schema
992+
|200 OK|v1.ImageStreamLayers
993+
|401 Unauthorized|
994+
|===
995+
996+
==== Consumes
997+
998+
* \*/*
999+
1000+
==== Produces
1001+
1002+
* application/json
1003+
* application/yaml
1004+
* application/vnd.kubernetes.protobuf
1005+
1006+
9531007
[[Get-apis-image.openshift.io-v1-namespaces-namespace-imagestreams-name-secrets]]
9541008
=== Get secrets of a ImageStream in a namespace
9551009
Read secrets of the specified ImageStream

api/protobuf-spec/github_com_openshift_api_image_v1.proto

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/swagger-spec/openshift-openapi-spec.json

Lines changed: 138 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/image/apis/image/register.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
7272
&ImageStreamTag{},
7373
&ImageStreamTagList{},
7474
&ImageStreamImage{},
75+
&ImageStreamLayers{},
7576
&ImageStreamImport{},
7677
&kapi.SecretList{},
7778
)

pkg/image/apis/image/types.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,35 @@ type DockerImageReference struct {
473473
ID string
474474
}
475475

476+
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
477+
478+
// ImageStreamLayers describes information about the layers referenced by images in this
479+
// image stream.
480+
type ImageStreamLayers struct {
481+
metav1.TypeMeta
482+
// Standard object's metadata.
483+
metav1.ObjectMeta
484+
// blobs is a map of blob name to metadata about the blob.
485+
Blobs map[string]ImageLayerData
486+
// layers is a map between an image name and the names of the blobs that form the
487+
// images.
488+
Layers map[string]BlobReferences
489+
// manifests is a map between an image name and the name of the manifest blob, if one
490+
// exists.
491+
Manifests map[string]string
492+
}
493+
494+
// BlobReferences is an array of names of blobs.
495+
type BlobReferences []string
496+
497+
// ImageLayerData contains metadata about an image layer.
498+
type ImageLayerData struct {
499+
// Size of the layer in bytes as defined by the underlying store.
500+
LayerSize int64
501+
// MediaType of the referenced object.
502+
MediaType string
503+
}
504+
476505
// +genclient
477506
// +genclient:onlyVerbs=create
478507
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

0 commit comments

Comments
 (0)