@@ -1190,10 +1190,10 @@ func (s *storageImageDestination) Commit(ctx context.Context, unparsedToplevel t
1190
1190
1191
1191
// If one of those blobs was a configuration blob, then we can try to dig out the date when the image
1192
1192
// was originally created, in case we're just copying it. If not, no harm done.
1193
- options := & storage.ImageOptions {}
1193
+ imgOptions := & storage.ImageOptions {}
1194
1194
if inspect , err := man .Inspect (s .getConfigBlob ); err == nil && inspect .Created != nil {
1195
1195
logrus .Debugf ("setting image creation date to %s" , inspect .Created )
1196
- options .CreationDate = * inspect .Created
1196
+ imgOptions .CreationDate = * inspect .Created
1197
1197
}
1198
1198
1199
1199
// Set up to save the non-layer blobs as data items. Since we only share layers, they should all be in files, so
@@ -1210,7 +1210,7 @@ func (s *storageImageDestination) Commit(ctx context.Context, unparsedToplevel t
1210
1210
if err != nil {
1211
1211
return fmt .Errorf ("copying non-layer blob %q to image: %w" , blob , err )
1212
1212
}
1213
- options .BigData = append (options .BigData , storage.ImageBigDataOption {
1213
+ imgOptions .BigData = append (imgOptions .BigData , storage.ImageBigDataOption {
1214
1214
Key : blob .String (),
1215
1215
Data : v ,
1216
1216
Digest : digest .Canonical .FromBytes (v ),
@@ -1227,7 +1227,7 @@ func (s *storageImageDestination) Commit(ctx context.Context, unparsedToplevel t
1227
1227
if err != nil {
1228
1228
return err
1229
1229
}
1230
- options .BigData = append (options .BigData , storage.ImageBigDataOption {
1230
+ imgOptions .BigData = append (imgOptions .BigData , storage.ImageBigDataOption {
1231
1231
Key : key ,
1232
1232
Data : toplevelManifest ,
1233
1233
Digest : manifestDigest ,
@@ -1240,19 +1240,19 @@ func (s *storageImageDestination) Commit(ctx context.Context, unparsedToplevel t
1240
1240
if err != nil {
1241
1241
return err
1242
1242
}
1243
- options .BigData = append (options .BigData , storage.ImageBigDataOption {
1243
+ imgOptions .BigData = append (imgOptions .BigData , storage.ImageBigDataOption {
1244
1244
Key : key ,
1245
1245
Data : s .manifest ,
1246
1246
Digest : s .manifestDigest ,
1247
1247
})
1248
- options .BigData = append (options .BigData , storage.ImageBigDataOption {
1248
+ imgOptions .BigData = append (imgOptions .BigData , storage.ImageBigDataOption {
1249
1249
Key : storage .ImageDigestBigDataKey ,
1250
1250
Data : s .manifest ,
1251
1251
Digest : s .manifestDigest ,
1252
1252
})
1253
1253
// Set up to save the signatures, if we have any.
1254
1254
if len (s .signatures ) > 0 {
1255
- options .BigData = append (options .BigData , storage.ImageBigDataOption {
1255
+ imgOptions .BigData = append (imgOptions .BigData , storage.ImageBigDataOption {
1256
1256
Key : "signatures" ,
1257
1257
Data : s .signatures ,
1258
1258
Digest : digest .Canonical .FromBytes (s .signatures ),
@@ -1263,7 +1263,7 @@ func (s *storageImageDestination) Commit(ctx context.Context, unparsedToplevel t
1263
1263
if err != nil {
1264
1264
return err
1265
1265
}
1266
- options .BigData = append (options .BigData , storage.ImageBigDataOption {
1266
+ imgOptions .BigData = append (imgOptions .BigData , storage.ImageBigDataOption {
1267
1267
Key : key ,
1268
1268
Data : signatures ,
1269
1269
Digest : digest .Canonical .FromBytes (signatures ),
@@ -1276,7 +1276,7 @@ func (s *storageImageDestination) Commit(ctx context.Context, unparsedToplevel t
1276
1276
return fmt .Errorf ("encoding metadata for image: %w" , err )
1277
1277
}
1278
1278
if len (metadata ) != 0 {
1279
- options .Metadata = string (metadata )
1279
+ imgOptions .Metadata = string (metadata )
1280
1280
}
1281
1281
1282
1282
// Create the image record, pointing to the most-recently added layer.
@@ -1288,7 +1288,7 @@ func (s *storageImageDestination) Commit(ctx context.Context, unparsedToplevel t
1288
1288
}
1289
1289
}
1290
1290
oldNames := []string {}
1291
- img , err := s .imageRef .transport .store .CreateImage (intendedID , nil , lastLayer , "" , options )
1291
+ img , err := s .imageRef .transport .store .CreateImage (intendedID , nil , lastLayer , "" , imgOptions )
1292
1292
if err != nil {
1293
1293
if ! errors .Is (err , storage .ErrDuplicateID ) {
1294
1294
logrus .Debugf ("error creating image: %q" , err )
@@ -1309,21 +1309,21 @@ func (s *storageImageDestination) Commit(ctx context.Context, unparsedToplevel t
1309
1309
// sizes (tracked in the metadata) which might have already
1310
1310
// been present with new values, when ideally we'd find a way
1311
1311
// to merge them since they all apply to the same image
1312
- for _ , data := range options .BigData {
1312
+ for _ , data := range imgOptions .BigData {
1313
1313
if err := s .imageRef .transport .store .SetImageBigData (img .ID , data .Key , data .Data , manifest .Digest ); err != nil {
1314
1314
logrus .Debugf ("error saving big data %q for image %q: %v" , data .Key , img .ID , err )
1315
1315
return fmt .Errorf ("saving big data %q for image %q: %w" , data .Key , img .ID , err )
1316
1316
}
1317
1317
}
1318
- if options .Metadata != "" {
1319
- if err := s .imageRef .transport .store .SetMetadata (img .ID , options .Metadata ); err != nil {
1318
+ if imgOptions .Metadata != "" {
1319
+ if err := s .imageRef .transport .store .SetMetadata (img .ID , imgOptions .Metadata ); err != nil {
1320
1320
logrus .Debugf ("error saving metadata for image %q: %v" , img .ID , err )
1321
1321
return fmt .Errorf ("saving metadata for image %q: %w" , img .ID , err )
1322
1322
}
1323
- logrus .Debugf ("saved image metadata %q" , options .Metadata )
1323
+ logrus .Debugf ("saved image metadata %q" , imgOptions .Metadata )
1324
1324
}
1325
1325
} else {
1326
- logrus .Debugf ("created new image ID %q with metadata %q" , img .ID , options .Metadata )
1326
+ logrus .Debugf ("created new image ID %q with metadata %q" , img .ID , imgOptions .Metadata )
1327
1327
}
1328
1328
1329
1329
// Clean up the unfinished image on any error.
0 commit comments