@@ -219,44 +219,44 @@ func readManifest(ctx context.Context, store content.Provider, desc ocispec.Desc
219219
220220// ImagePlatform returns the platform of the image manifest.
221221// If the manifest list doesn't have a platform filled, it will be read from the config.
222- func (m * ImageManifest ) ImagePlatform (ctx context.Context ) (ocispec.Platform , error ) {
223- target := m .Target ()
222+ func (im * ImageManifest ) ImagePlatform (ctx context.Context ) (ocispec.Platform , error ) {
223+ target := im .Target ()
224224 if target .Platform != nil {
225225 return * target .Platform , nil
226226 }
227227
228228 var out ocispec.Platform
229- err := m .ReadConfig (ctx , & out )
229+ err := im .ReadConfig (ctx , & out )
230230 return out , err
231231}
232232
233233// ReadConfig gets the image config and unmarshals it into the provided struct.
234234// The provided struct should be a pointer to the config struct or its subset.
235- func (m * ImageManifest ) ReadConfig (ctx context.Context , outConfig interface {}) error {
236- configDesc , err := m .Config (ctx )
235+ func (im * ImageManifest ) ReadConfig (ctx context.Context , outConfig interface {}) error {
236+ configDesc , err := im .Config (ctx )
237237 if err != nil {
238238 return err
239239 }
240240
241- return readJSON (ctx , m .ContentStore (), configDesc , outConfig )
241+ return readJSON (ctx , im .ContentStore (), configDesc , outConfig )
242242}
243243
244244// PresentContentSize returns the size of the image's content that is present in the content store.
245- func (m * ImageManifest ) PresentContentSize (ctx context.Context ) (int64 , error ) {
246- cs := m .ContentStore ()
245+ func (im * ImageManifest ) PresentContentSize (ctx context.Context ) (int64 , error ) {
246+ cs := im .ContentStore ()
247247 var size int64
248248 err := c8dimages .Walk (ctx , presentChildrenHandler (cs , func (ctx context.Context , desc ocispec.Descriptor ) ([]ocispec.Descriptor , error ) {
249249 size += desc .Size
250250 return nil , nil
251- }), m .Target ())
251+ }), im .Target ())
252252 return size , err
253253}
254254
255255// SnapshotUsage returns the disk usage of the image's snapshots.
256- func (m * ImageManifest ) SnapshotUsage (ctx context.Context , snapshotter snapshots.Snapshotter ) (snapshots.Usage , error ) {
257- diffIDs , err := m .RootFS (ctx )
256+ func (im * ImageManifest ) SnapshotUsage (ctx context.Context , snapshotter snapshots.Snapshotter ) (snapshots.Usage , error ) {
257+ diffIDs , err := im .RootFS (ctx )
258258 if err != nil {
259- return snapshots.Usage {}, errors .Wrapf (err , "failed to get rootfs of image %s" , m .Name ())
259+ return snapshots.Usage {}, errors .Wrapf (err , "failed to get rootfs of image %s" , im .Name ())
260260 }
261261
262262 imageSnapshotID := identity .ChainID (diffIDs ).String ()
@@ -266,12 +266,12 @@ func (m *ImageManifest) SnapshotUsage(ctx context.Context, snapshotter snapshots
266266 return snapshots.Usage {Size : 0 }, nil
267267 }
268268 log .G (ctx ).WithError (err ).WithFields (log.Fields {
269- "image" : m .Name (),
270- "target" : m .Target (),
269+ "image" : im .Name (),
270+ "target" : im .Target (),
271271 "snapshotID" : imageSnapshotID ,
272272 }).Warn ("failed to calculate snapshot usage of image" )
273273
274- return snapshots.Usage {}, errors .Wrapf (err , "failed to calculate snapshot usage of image %s" , m .Name ())
274+ return snapshots.Usage {}, errors .Wrapf (err , "failed to calculate snapshot usage of image %s" , im .Name ())
275275 }
276276 return unpackedUsage , nil
277277}
0 commit comments