Skip to content

Commit

Permalink
blobinfocache,sqlite: remove unnecessary compression check
Browse files Browse the repository at this point in the history
Following check is not needed and can be removed. Followup fix from
containers#1645 (comment)

Signed-off-by: Aditya R <arajan@redhat.com>
  • Loading branch information
flouthoc committed Nov 1, 2023
1 parent 6c186a9 commit e405750
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/blobinfocache/sqlite/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,19 +472,15 @@ func (sqc *cache) appendReplacementCandidates(candidates []prioritize.CandidateW
}

if len(res) == 0 && v2Output {
compressorName := blobinfocache.UnknownCompression
compressor, found, err := querySingleValue[string](tx, "SELECT compressor FROM DigestCompressors WHERE digest = ?", digest.String())
if err != nil {
return nil, fmt.Errorf("scanning compressorName: %w", err)
}
if found {
compressorName = compressor
}
if compressorName != blobinfocache.UnknownCompression {
res = append(res, prioritize.CandidateWithTime{
Candidate: blobinfocache.BICReplacementCandidate2{
Digest: digest,
CompressorName: compressorName,
CompressorName: compressor,
UnknownLocation: true,
Location: types.BICLocationReference{Opaque: ""},
},
Expand Down

0 comments on commit e405750

Please sign in to comment.