Skip to content

Commit

Permalink
Merge pull request #57 from AliyunContainerService/bugfix/ineffectual…
Browse files Browse the repository at this point in the history
…-assignment-fix

ineffectual assignment fix
  • Loading branch information
hhyasdf authored Nov 20, 2020
2 parents f60664f + 3b39fa9 commit 3b2623e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion pkg/sync/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ func ManifestHandler(m []byte, t string, i *ImageSource) ([]manifest.Manifest, e
if err != nil {
return nil, err
}

platformSpecManifest, err := ManifestHandler(manifestByte, manifestType, i)
manifestInfoSlice = append(manifestInfoSlice, platformSpecManifest...)
if err != nil {
return nil, err
}

manifestInfoSlice = append(manifestInfoSlice, platformSpecManifest...)
}
return manifestInfoSlice, nil
}
Expand Down
7 changes: 6 additions & 1 deletion pkg/sync/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ func (t *Task) Run() error {
for _, manifestDescriptorElem := range manifestSchemaListInfo.Manifests {

t.Infof("handle manifest OS:%s Architecture:%s ", manifestDescriptorElem.Platform.OS, manifestDescriptorElem.Platform.Architecture)
subManifestByte, manifestType, err = t.source.source.GetManifest(t.source.ctx, &manifestDescriptorElem.Digest)

subManifestByte, _, err = t.source.source.GetManifest(t.source.ctx, &manifestDescriptorElem.Digest)
if err != nil {
return t.Errorf("Get manifest %v of OS:%s Architecture:%s for manifest list error: %v", manifestDescriptorElem.Digest, manifestDescriptorElem.Platform.OS, manifestDescriptorElem.Platform.Architecture, err)
}

if err := t.destination.PushManifest(subManifestByte); err != nil {
return t.Errorf("Put manifest to %s/%s:%s error: %v", t.destination.GetRegistry(), t.destination.GetRepository(), t.destination.GetTag(), err)
}
Expand Down

0 comments on commit 3b2623e

Please sign in to comment.