Make checksum error non retryable error

This commit is contained in:
Mustafa Gezen 2023-09-06 23:29:08 +02:00
parent 1ed6fd238f
commit 8804d76566
Signed by: mustafa
GPG Key ID: DCDF010D946438C1

View File

@ -100,7 +100,11 @@ func (w *Worker) ImportRPM(uri string, checksumSha256 string, osRelease string)
return nil, errors.Wrap(err, "failed to hash resource")
}
if hex.EncodeToString(hash.Sum(nil)) != checksumSha256 {
return nil, errors.New("checksum does not match")
return nil, temporal.NewNonRetryableApplicationError(
"checksum does not match",
"checksumDoesNotMatch",
errors.New("client submitted a checksum that does not match the resource"),
)
}
// Read the RPM headers