Merge pull request #44617 from thaJeztah/23.0_backport_images_errdefs

[23.0 backport] image/store: Use errdefs for errors
This commit is contained in:
Sebastiaan van Stijn
2022-12-09 21:31:25 +01:00
committed by GitHub
17 changed files with 128 additions and 115 deletions

View File

@@ -323,7 +323,7 @@ func (s *DockerRegistrySuite) TestPullManifestList(c *testing.T) {
assert.NilError(c, err, "error marshalling manifest list")
manifestListDigest := digest.FromBytes(manifestListJSON)
hexDigest := manifestListDigest.Hex()
hexDigest := manifestListDigest.Encoded()
registryV2Path := s.reg.Path()

View File

@@ -123,7 +123,7 @@ func (s *DockerCLISaveLoadSuite) TestSaveCheckTimes(c *testing.T) {
out, err = RunCommandPipelineWithOutput(
exec.Command(dockerBinary, "save", repoName),
exec.Command("tar", "tv"),
exec.Command("grep", "-E", fmt.Sprintf("%s %s", data[0].Created.Format(tarTvTimeFormat), digest.Digest(data[0].ID).Hex())))
exec.Command("grep", "-E", fmt.Sprintf("%s %s", data[0].Created.Format(tarTvTimeFormat), digest.Digest(data[0].ID).Encoded())))
assert.NilError(c, err, "failed to save repo with image ID and 'repositories' file: %s, %v", out, err)
}
@@ -258,7 +258,7 @@ func (s *DockerCLISaveLoadSuite) TestSaveRepoWithMultipleImages(c *testing.T) {
// prefixes are not in tar
for i := range expected {
expected[i] = digest.Digest(expected[i]).Hex()
expected[i] = digest.Digest(expected[i]).Encoded()
}
sort.Strings(actual)