Skip to content

Commit 8e74bdc

Browse files
committed
Remove "sort.Strings" on manifest-list digest comparisons
This bug causes reorderings (like the one required for docker-library/mongo#444) to incorrectly no-op because order actually *does* matter here.
1 parent a0906cb commit 8e74bdc

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

cmd/bashbrew/cmd-put-shared.go

-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"os"
66
"path"
77
"reflect"
8-
"sort"
98
"strings"
109

1110
"github.com/urfave/cli"
@@ -143,7 +142,6 @@ func cmdPutShared(c *cli.Context) error {
143142
return err
144143
}
145144

146-
sort.Strings(expectedRemoteDigests)
147145
if len(expectedRemoteDigests) < 1 {
148146
// if "expectedRemoteDigests" comes back empty, we've probably got an API issue (or a build error/push timing problem)
149147
fmt.Fprintf(os.Stderr, "warning: no images expected to push for %q\n", fmt.Sprintf("%s:%s", targetRepo, group.SharedTags[0]))
@@ -154,7 +152,6 @@ func cmdPutShared(c *cli.Context) error {
154152
image := fmt.Sprintf("%s:%s", targetRepo, tag)
155153
if !force {
156154
remoteDigests := fetchRegistryManiestListDigests(image)
157-
sort.Strings(remoteDigests)
158155
if len(expectedRemoteDigests) == 0 && remoteDigests == nil {
159156
// https://github.com/golang/go/issues/12918 ...
160157
remoteDigests = []string{}

0 commit comments

Comments
 (0)