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
Fix writing of corrupt Artifact: type-info is missing type for rootfs… #330
Conversation
Hello 😸 I created a pipeline for you here: Pipeline-260289028 Build Configuration Matrix
|
…-image. Changelog: Fix regression which caused the "write rootfs-image" command to produce a corrupt Artifact. The same versions that write such an Artifact will also accept it, but both issues have been fixed: A corrupt Artifact is not written anymore, nor will corrupt Artifacts be accepted. If you have produced an Artifact using a version of mender-artifact prior to 3.5.1, you may have to recreate it. Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
dfee237
to
fb0ff47
Compare
Hello 😸 I created a pipeline for you here: Pipeline-260294102 Build Configuration Matrix
|
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.
Sneaky bug. The fix looks good to me, but last word is on @oleorhagen
And very 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 was worrying! Nice find though
if img.typeInfoV3 == nil || img.typeInfoV3.Type != img.updateType { | ||
return errors.New("Type in type-info header does not match header-info: " + | ||
"Corrupt Artifact. " + | ||
"This was a known bug in some versions of mender-artifact prior to 3.5.1. " + |
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.
Suggestion: How about: is a known bug?
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.
Good point, I will change that.
@@ -184,6 +191,10 @@ func MakeAnyImageArtifact(version int, signed bool, | |||
ArtifactName: []string{"mender-1.0"}, | |||
CompatibleDevices: []string{"vexpress"}, | |||
}, | |||
TypeInfoV3: &artifact.TypeInfoV3{ |
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.
Ouch
@kacf did you forget about this one? 😸 |
No, but I want to take a bit more time to think about this. As we discussed, maybe it's better to remove the field altogether. I'll return to it once I have fewer things on my plate! :-) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
…-image.
Changelog: Fix regression which caused the "write rootfs-image"
command to produce a corrupt Artifact. The same versions that write
such an Artifact will also accept it, but both issues have been fixed:
A corrupt Artifact is not written anymore, nor will corrupt Artifacts
be accepted. If you have produced an Artifact using a version of
mender-artifact prior to 3.5.1, you may have to recreate it.
Signed-off-by: Kristian Amlie kristian.amlie@northern.tech