pkg/ioutils: remove crypto/sha256, crypto/sha512 imports#49281
Merged
AkihiroSuda merged 1 commit intomoby:masterfrom Jan 15, 2025
Merged
pkg/ioutils: remove crypto/sha256, crypto/sha512 imports#49281AkihiroSuda merged 1 commit intomoby:masterfrom
AkihiroSuda merged 1 commit intomoby:masterfrom
Conversation
commit 572498b moved the ioutils.HashData utility to the libnetwork resolvconf package. After removing, we saw some tests in the reference pacakge failing; === 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 Those failures were because those tests depended on a side-effect of the ioutils package being imported, which (before removal of HashData) imported crypto/sha256, registering that algorithms, which on its turn was used by github.com/opencontainers/go-digest to determnin if a given algorithm must be accepted (see [go-digest#64]). As a workaround, these imports were added. pkg/ioutils is now imported in less places, and should not be depended on for this purpose. Let's remove this workaround; if needed, these imports can be added in a more relevant location. This reverts commit 98caf09. [go-digest#64]: opencontainers/go-digest#64 Signed-off-by: Sebastiaan van Stijn <[email protected]>
AkihiroSuda
approved these changes
Jan 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
relates to:
commit 572498b moved the ioutils.HashData utility to the libnetwork resolvconf package.
After removing, we saw some tests in the reference pacakge failing;
Those failures were because those tests depended on a side-effect of the ioutils package being imported, which (before removal of HashData) imported crypto/sha256, registering that algorithms, which on its turn was used by github.com/opencontainers/go-digest to determnin if a given algorithm must be accepted (see go-digest#64).
As a workaround, these imports were added. pkg/ioutils is now imported in less places, and should not be depended on for this purpose.
Let's remove this workaround; if needed, these imports can be added in a more relevant location.
This reverts commit 98caf09.
- What I did
- How I did it
- How to verify it
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)