moby--moby/pkg/ioutils
Sebastiaan van Stijn 98caf09f0f
fix go-digest to make sure the algorithms are registered
Previously, ioutils imported the crypty/sha256 package, because it was
used by the HashData() utility. As a side-effect of that import, the
sha256 algorithm was registered through its `init()` function.

Now that the HashData() utility is removed, the import is no longer needed
in this package, but some parts of our code depended on the side-effect, and
without this, it fail to recognise the algorithms, unless something else
happens to import crypto/sha256 / crypto/sha512, which made our
tests fail:

```
=== Failed
=== FAIL: reference TestLoad (0.00s)
    store_test.go:53: failed to parse reference: unsupported digest algorithm

=== FAIL: reference TestSave (0.00s)
    store_test.go:82: failed to parse reference: unsupported digest algorithm

=== FAIL: reference TestAddDeleteGet (0.00s)
    store_test.go:174: could not parse reference: unsupported digest algorithm

=== FAIL: reference TestInvalidTags (0.00s)
    store_test.go:355: assertion failed: error is not nil: unsupported digest algorithm
```

While it would be better to do the import in the actual locations where it's
expected, there may be code-paths we overlook, so instead adding the import
here temporarily. Until the PR in go-digest has been merged and released.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2021-08-20 00:35:41 +02:00
..
buffer.go Add canonical import comment 2018-02-05 16:51:57 -05:00
buffer_test.go Add canonical import comment 2018-02-05 16:51:57 -05:00
bytespipe.go Fixed the inconsistence and also a potential data race in pkg/ioutils/bytespipe.go: bp.closeErr is read/write 8 times; 7 out of 8 times it is protected by bp.mu.Lock(); 1 out of 8 times it is read without a Lock 2019-07-01 11:38:38 -07:00
bytespipe_test.go pkg/ioutils use sha256 instead of sha1 in tests 2019-09-18 12:57:35 +02:00
fswriters.go Add canonical import comment 2018-02-05 16:51:57 -05:00
fswriters_test.go unconvert: remove unnescessary conversions 2019-09-18 12:57:33 +02:00
readers.go fix go-digest to make sure the algorithms are registered 2021-08-20 00:35:41 +02:00
readers_test.go move pkg/ioutils.HashData() to libnetwork/resolvconf 2021-08-20 00:35:39 +02:00
temp_unix.go Add canonical import comment 2018-02-05 16:51:57 -05:00
temp_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00
writeflusher.go Add canonical import comment 2018-02-05 16:51:57 -05:00
writers.go Add canonical import comment 2018-02-05 16:51:57 -05:00
writers_test.go Add canonical import comment 2018-02-05 16:51:57 -05:00