mirror of
https://github.com/moby/moby.git
synced 2026-08-10 17:15:06 +00:00
image/tarexport: saveSession.save: inline variables
Remove some intermediate variables that were only used in a single place. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -237,7 +237,7 @@ func (s *saveSession) save(ctx context.Context, outStream io.Writer) error {
|
||||
})
|
||||
}
|
||||
|
||||
m := ocispec.Manifest{
|
||||
data, err := json.Marshal(ocispec.Manifest{
|
||||
Versioned: specs.Versioned{
|
||||
SchemaVersion: 2,
|
||||
},
|
||||
@@ -248,9 +248,7 @@ func (s *saveSession) save(ctx context.Context, outStream io.Writer) error {
|
||||
Size: int64(len(imageDescr.image.RawJSON())),
|
||||
},
|
||||
Layers: foreign,
|
||||
}
|
||||
|
||||
data, err := json.Marshal(m)
|
||||
})
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "error marshaling manifest")
|
||||
}
|
||||
@@ -269,12 +267,11 @@ func (s *saveSession) save(ctx context.Context, outStream io.Writer) error {
|
||||
if err := system.Chtimes(mFile, time.Unix(0, 0), time.Unix(0, 0)); err != nil {
|
||||
return errors.Wrap(err, "error setting blob directory timestamps")
|
||||
}
|
||||
size := int64(len(data))
|
||||
|
||||
untaggedMfstDesc := ocispec.Descriptor{
|
||||
MediaType: ocispec.MediaTypeImageManifest,
|
||||
Digest: dgst,
|
||||
Size: size,
|
||||
Size: int64(len(data)),
|
||||
}
|
||||
for _, ref := range imageDescr.refs {
|
||||
familiarName := reference.FamiliarName(ref)
|
||||
|
||||
Reference in New Issue
Block a user