-
Notifications
You must be signed in to change notification settings - Fork 385
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
listupdate,oci: instance show read-only annotations
and CompressionAlgorithmNames
#2040
Conversation
@mtrmac @vrothberg PTAL |
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.
For #1987 : the manifest
format handlers implement mapping algorithms to annotations, so they should also implement mapping annotations to algorithms.
I.e. add a CompressionAlgorithms
field instead. Or rather, maybe CompressionAlgorithmNames
instead, so that internal/manifest
does not depend on pkg/compression.AlgorithmByName
and does not bring all of c/storage/pkg/chunked/compressor to every metadata-only user.
(Adding annotations as well wouldn’t hurt but I think isn‘t immediately relevant.)
e0910b9
to
9d5e193
Compare
annotations
annotations
and CompressionAlgorithmNames
9d5e193
to
c650bd4
Compare
internal/manifest/list.go
Outdated
Digest digest.Digest | ||
Size int64 | ||
MediaType string | ||
Platform *imgspecv1.Platform // read-only field: may be set by Instance(), ignored by UpdateInstance() |
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.
Consider moving the read-only fields into an inner struct:
type ListUpdate struct {
[...]
struct ReadOnly {
Platform string
[...]
}
}
This way, all users have to access it via (ListUpdate).ReadOnly.Platform
which is quite expressive.
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.
Nice Idea, Done
c650bd4
to
54c1a97
Compare
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.
LGTM
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.
One last nit please
54c1a97
to
83a64f5
Compare
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.
Thanks!
…gorithmNames There is a need to read annotations of a particular instance to get its compression. Expose `Annotations` as a read-only field. Needed By: containers#1987 Signed-off-by: Aditya R <[email protected]>
83a64f5
to
d9fc9d5
Compare
@mtrmac Thanks for the rebase :) ready for merge |
There is a need to read annotations of a particular instance to get its compression. Expose
Annotations
as a read-only field.Needed By: #1987
Annotations will be used by
prepareInstanceCopies
of above PR to detect compression on the instance.