-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide layers referenced by an image stream as layers subresource #19969
Changes from all commits
1b3d5dc
16d3f5d
81e6e1c
aac71d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -469,6 +469,43 @@ type ImageStreamImage struct { | |
// DockerImageReference points to a Docker image. | ||
type DockerImageReference = reference.DockerImageReference | ||
|
||
// +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 | ||
// images is a map between an image name and the names of the blobs and manifests that | ||
// comprise the image. | ||
Images map[string]ImageBlobReferences | ||
} | ||
|
||
// ImageBlobReferences describes the blob references within an image. | ||
type ImageBlobReferences struct { | ||
// 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 | ||
// not have separate manifest blobs and this field will be set to nil if so. | ||
// +optional | ||
Manifest *string | ||
} | ||
|
||
// ImageLayerData contains metadata about an image layer. | ||
type ImageLayerData struct { | ||
// Size of the layer in bytes as defined by the underlying store. This field is | ||
// optional if the necessary information about size is not available. | ||
LayerSize *int64 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have an immediate use-case for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needed for the caches used inside of the registry that answer hits about blobs. If we don't have this info, we'd have to make an other O(N) calls to get it. Same for media type. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On registry side this information will be cached once again. Maybe it's better to make a watcher on registry side and cache it just once per registry ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. caching on the apiserver side has the benefit of helping anyone who invokes the api, not just the registry. (e.g. maybe pruning uses it in the future?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @bparees My question was because of the worry of spending the master's memory on another large cache. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I figured, I was just expressing a reason it might be worth paying that cost. (Ultimately I think @smarterclayton convinced himself that this cache won't be that big) |
||
// MediaType of the referenced object. | ||
MediaType string | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see this being consumed either. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. comment bump |
||
} | ||
|
||
// +genclient | ||
// +genclient:onlyVerbs=create | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be necessary. Don't add yourself to the whitelist above and you should be good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is required for some reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment bump