Skip to content

Commit 42ff0ca

Browse files
committed
Fix bugs with the dockerlib output for variants
1 parent ac3f9ae commit 42ff0ca

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

dockerlib/dockerlib/manifest.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ func ReadImageManifest(fpath string) (*ImageManifest, error) {
7373

7474
// Propagate the image values to the variants and determine the base directory
7575
// and the latest version.
76-
for _, variant := range manifest.Variants {
76+
for i, variant := range manifest.Variants {
7777
if len(variant.Versions) == 0 {
78-
variant.Versions = manifest.Versions
79-
variant.Latest = manifest.Latest
78+
manifest.Variants[i].Versions = manifest.Versions
79+
manifest.Variants[i].Latest = manifest.Latest
8080
} else {
81-
variant.Latest = Versions(variant.Versions).Latest().String()
81+
manifest.Variants[i].Latest = Versions(variant.Versions).Latest().String()
8282
}
8383
}
8484
return &manifest, nil
@@ -148,7 +148,7 @@ func (m *ImageManifest) Write(w io.Writer, header *Header) error {
148148
}
149149
header.Add("Tags", strings.Join(parts, ".")+"-"+variant.Name)
150150
}
151-
if m.Latest == v.String() {
151+
if variant.Latest == v.String() {
152152
header.Add("Tags", variant.Name)
153153
}
154154
for _, arch := range variant.Architectures {

0 commit comments

Comments
 (0)