Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
| ... | ... |
@@ -44,7 +44,7 @@ func (c cacheAdaptor) Get(id image.ID) (*image.Image, error) {
|
| 44 | 44 |
return nil, fmt.Errorf("resolveImage: %w", err)
|
| 45 | 45 |
} |
| 46 | 46 |
|
| 47 |
- var errFound = errors.New("success")
|
|
| 47 |
+ errFound := errors.New("success")
|
|
| 48 | 48 |
err = c.is.walkImageManifests(ctx, c8dImg, func(img *ImageManifest) error {
|
| 49 | 49 |
desc, err := img.Config(ctx) |
| 50 | 50 |
if err != nil {
|
| ... | ... |
@@ -13,7 +13,6 @@ import ( |
| 13 | 13 |
// getImagesWithLabel returns all images that have the matching label key and value. |
| 14 | 14 |
func (i *ImageService) getImagesWithLabel(ctx context.Context, labelKey string, labelValue string) ([]image.ID, error) {
|
| 15 | 15 |
imgs, err := i.images.List(ctx, "labels."+labelKey+"=="+labelValue) |
| 16 |
- |
|
| 17 | 16 |
if err != nil {
|
| 18 | 17 |
return []image.ID{}, errdefs.System(errors.Wrap(err, "failed to list all images"))
|
| 19 | 18 |
} |
| ... | ... |
@@ -131,7 +131,6 @@ func (i *ImageService) ExportImage(ctx context.Context, names []string, outStrea |
| 131 | 131 |
|
| 132 | 132 |
for _, img := range imgs {
|
| 133 | 133 |
ref, err := reference.ParseNamed(img.Name) |
| 134 |
- |
|
| 135 | 134 |
if err != nil {
|
| 136 | 135 |
log.G(ctx).WithFields(log.Fields{
|
| 137 | 136 |
"image": img.Name, |
| ... | ... |
@@ -299,7 +298,6 @@ func (i *ImageService) LoadImage(ctx context.Context, inTar io.ReadCloser, outSt |
| 299 | 299 |
|
| 300 | 300 |
if !unpacked {
|
| 301 | 301 |
err = platformImg.Unpack(ctx, i.snapshotter) |
| 302 |
- |
|
| 303 | 302 |
if err != nil {
|
| 304 | 303 |
return errdefs.System(err) |
| 305 | 304 |
} |
| ... | ... |
@@ -209,7 +209,6 @@ func (i *ImageService) Images(ctx context.Context, opts imagetypes.ListOptions) |
| 209 | 209 |
func (i *ImageService) imageSummary(ctx context.Context, img images.Image, platformMatcher platforms.MatchComparer, |
| 210 | 210 |
opts imagetypes.ListOptions, tagsByDigest map[digest.Digest][]string, |
| 211 | 211 |
) (_ *imagetypes.Summary, allChainIDs []digest.Digest, _ error) {
|
| 212 |
- |
|
| 213 | 212 |
// Total size of the image including all its platform |
| 214 | 213 |
var totalSize int64 |
| 215 | 214 |
|
| ... | ... |
@@ -267,7 +267,6 @@ func desc(size int64) ocispec.Descriptor {
|
| 267 | 267 |
Size: size, |
| 268 | 268 |
MediaType: ocispec.MediaTypeImageIndex, |
| 269 | 269 |
} |
| 270 |
- |
|
| 271 | 270 |
} |
| 272 | 271 |
|
| 273 | 272 |
func digestFor(i int64) digest.Digest {
|
| ... | ... |
@@ -284,7 +283,7 @@ func newTestDB(ctx context.Context, t testing.TB) *metadata.DB {
|
| 284 | 284 |
t.Helper() |
| 285 | 285 |
|
| 286 | 286 |
p := filepath.Join(t.TempDir(), "metadata") |
| 287 |
- bdb, err := bbolt.Open(p, 0600, &bbolt.Options{})
|
|
| 287 |
+ bdb, err := bbolt.Open(p, 0o600, &bbolt.Options{})
|
|
| 288 | 288 |
if err != nil {
|
| 289 | 289 |
t.Fatal(err) |
| 290 | 290 |
} |
| ... | ... |
@@ -23,7 +23,6 @@ func (i *ImageService) softImageDelete(ctx context.Context, img containerdimages |
| 23 | 23 |
// Create dangling image if this is the last image pointing to this target. |
| 24 | 24 |
if len(imgs) == 1 {
|
| 25 | 25 |
err := i.ensureDanglingImage(context.WithoutCancel(ctx), img) |
| 26 |
- |
|
| 27 | 26 |
// Error out in case we couldn't persist the old image. |
| 28 | 27 |
if err != nil {
|
| 29 | 28 |
return errdefs.System(errors.Wrapf(err, "failed to create a dangling image for the replaced image %s with digest %s", |