tvalentyn commented on code in PR #37974:
URL: https://github.com/apache/beam/pull/37974#discussion_r3184837346
##########
sdks/go/pkg/beam/artifact/materialize.go:
##########
@@ -231,7 +233,18 @@ func (a artifact) retrieve(ctx context.Context, dest
string) error {
stat, _ := fd.Stat()
log.Printf("Downloaded: %v (sha256: %v, size: %v)", filename,
sha256Hash, stat.Size())
- return fd.Close()
+ if err := fd.Close(); err != nil {
+ return err
+ }
+
+ if isArtifactValidationEnabled(ctx) {
+ if a.expectedSha256 != "" && sha256Hash != a.expectedSha256 {
+ return errors.Errorf("bad SHA256 for %v: %v, want %v",
filename, sha256Hash, a.expectedSha256)
+ }
+ log.Printf("Sha256 validation done for file: %v, with sha256
%v", filename, a.expectedSha256)
Review Comment:
+1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]