Support checksum algorithm mismatch (+ other fixes) #227
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
We have various repos building UBI-based containers using rpmoci. That presents a problem, because whenever an RPM is bumped upstream, the old version is yanked and locked rpmoci builds break immediately.
We tried to mitigate this by using an Artifactory mirror, but that gets the metadata to serve up from the upstream rather than its own cache, so RPMs still become unavailable to dnf even if they're cached by the internal mirror configured in rpmoci.toml.
We therefore added a separate internal escrow RPM store. That faced two issues:
A non-issue that allows this to work is that we don't check GPG keys on these internal repos, which makes them interchangeable at install time because the repoid field in the lockfile is only used for GPG checking.
Fix
The code changes don't specifically mention escrow, and instead refer to the more general case that the checksum algorithm (and checksum) differ between resolution and download, which in theory could happen for other reasons too. For example, metadata could be updated to use a more secure hash algorithm.
Packageclass to make this easier to write.Example of configuring escrow, note that the priority needs to be quoted because the
optionshash requires both keys and values to be strings:Bonus fixes
3to be printed during rpmoci updates.This also bumps the version to get a new release out.
Testing
Compiled locally and:
excludepkgs = "*"for all but the escrow repo. Locked build succeeds, despite the lockfile having sha256 checksums and the escrow metadata having sha1.