-
Notifications
You must be signed in to change notification settings - Fork 165
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
set MediaType in BlobStatus from VerifyImageStatus #4511
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,7 +95,7 @@ func (status BlobStatus) LogCreate(logBase *base.LogObject) { | |
logObject.CloneAndAddField("state", status.State.String()). | ||
AddField("datastoreid-uuids", uuids). | ||
AddField("size-int64", status.Size). | ||
AddField("blobtype-string", status.MediaType). | ||
AddField("mediatype", status.MediaType). | ||
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'm not sure why, but it looks like there is an implicit convention of "name-type" for all these fields. Shouldn't we at least follow it? 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. Tbh I have no idea why it's there. And some fields like |
||
AddField("refcount-int64", status.RefCount). | ||
AddField("has-verifier-ref-bool", status.HasVerifierRef). | ||
AddField("has-downloader-ref-bool", status.HasDownloaderRef). | ||
|
@@ -116,6 +116,7 @@ func (status BlobStatus) LogModify(logBase *base.LogObject, old interface{}) { | |
oldStatus.Size != status.Size { | ||
|
||
logObject.CloneAndAddField("state", status.State.String()). | ||
AddField("mediatype", status.MediaType). | ||
AddField("refcount-int64", status.RefCount). | ||
AddField("size-int64", status.Size). | ||
AddField("has-verifier-ref-bool", status.HasVerifierRef). | ||
|
@@ -145,6 +146,7 @@ func (status BlobStatus) LogDelete(logBase *base.LogObject) { | |
logObject := base.EnsureLogObject(logBase, base.BlobStatusLogType, status.RelativeURL, | ||
nilUUID, status.LogKey()) | ||
logObject.CloneAndAddField("state", status.State.String()). | ||
AddField("mediatype", status.MediaType). | ||
AddField("refcount-int64", status.RefCount). | ||
AddField("size-int64", status.Size). | ||
AddField("has-verifier-ref-bool", status.HasVerifierRef). | ||
|
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.
I think it's important to note that sometimes we set the
MediaType
based on theDownloaderStatus
as well:eve/pkg/pillar/cmd/volumemgr/blob.go
Line 194 in 5f70ef8
This was added in a commit by @deitch: 5f70ef8
It looks like the change proposed in this PR corresponds to the change in the mentioned commit—both aim to ensure that the
MediaType
is set when it's absent for some reason. As far as I understand, if we use the proposed approach, the previous change becomes unnecessary. Or am I wrong? In any case, we need to understand how these parts of the code that setMediaType
correspond to each other.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.
That is the hardest part. This seems to make sense to me, but the interplay between them is hard to understand.
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.
I agree with both of you. But I also don't see any harm in setting it here.
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.
do we have any test to reproduce the bug / verify that the fix is working?
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.
@OhmSpectator which test does this refer to?
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.
https://github.com/zededa/bug-reproduction/tree/main/ci-197 here it is, but it requires some extra setup, if I remember correctly
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.
@OhmSpectator , I've seen some times (not often) an error of mismatching layers while deploying container applications on arm devices. However, I could never reproduce precisely... what I do know is that when it happens it's because of some
application/vnd.lfedge.disk.layer.v1+raw
layers (the disk images), that we know that these media types ares not integrated to containerd...I think these changes are harmless (I did few tests on my side), and as @europaul mentioned, it can help to debug, I will approve to let Eden tests run... let's see how it goes...