-
Notifications
You must be signed in to change notification settings - Fork 106
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
Allow any hashing algorithm in osbuild stage inputs #3514
Conversation
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, great work!
be20153
to
498b86f
Compare
I also did a test locally with a custom repo using the Before the fix, grepping through the stage inputs of the manifest in the job store:
and after
|
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.
Looks good, perhaps we want to assert the comment in NewFilesInputSourceObjectRef
?
Yeah good idea as a sanity check. |
Helper functions that create stage input objects with references always hard-coded `sha256:` as a prefix/algorithm for the checksum. This prevents the functions from being used in cases where other algorithms are use, like sha1, which is possible with (perhaps older) RPM repositories. The inputs in osbuild a number of hashing algorithms and we should be able to generate stages with other prefixes when necessary. Remove the `sha256:` prefix in the helper functions and assume all arguments to these functions provide the correct prefix. Update tests to match.
Unit test for the function where the original issue was located. See rhbz#2215043.
Make sure checksums used in the file input helper functions contain only 1 colon delimiter and it is not at the start of the string. Adjusted tests to work with new restriction.
d9dccd0
to
3ccc2a8
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.
Manifest-diff
job [0] as manifests.diff
.
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.
👍
Helper functions that create stage input objects with references always hard-coded
sha256:
as a prefix/algorithm for the checksum. This prevents the functions from being used in cases where other algorithms are use, like sha1, which is possible with (perhaps older) RPM repositories. The inputs in osbuild a number of hashing algorithms and we should be able to generate stages with other prefixes when necessary.This PR removes the
sha256:
prefix in the helper functions and assumes all arguments to these functions provide the correct prefix.Fixes rhbz#2215043 (RHELPLAN-159871).
This pull request includes: