Merge pull request #8495 from justinsb/fix_md5

GCS: Fix bug where around retry on GCS
This commit is contained in:
Kubernetes Prow Robot 2020-02-06 18:10:33 -08:00 committed by GitHub
commit 5dc38b911f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 7 deletions

View File

@ -135,14 +135,12 @@ func (p *GSPath) Join(relativePath ...string) Path {
}
func (p *GSPath) WriteFile(data io.ReadSeeker, acl ACL) error {
md5Hash, err := hashing.HashAlgorithmMD5.Hash(data)
if err != nil {
return err
}
done, err := RetryWithBackoff(gcsWriteBackoff, func() (bool, error) {
klog.V(4).Infof("Writing file %q", p)
md5Hash, err := hashing.HashAlgorithmMD5.Hash(data)
if err != nil {
return false, err
}
obj := &storage.Object{
Name: p.key,
Md5Hash: base64.StdEncoding.EncodeToString(md5Hash.HashValue),