mirror of
https://github.com/containerd/containerd.git
synced 2026-11-06 05:17:02 +00:00
client: fix perfsprint linting
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
4 files changed
+7
-7
No files matched your search
@@ -20,7 +20,6 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"runtime"
|
||||
|
||||
tasks "github.com/containerd/containerd/api/services/tasks/v1"
|
||||
@@ -118,7 +117,7 @@ func WithCheckpointRuntime(ctx context.Context, client *Client, c *containers.Co
|
||||
// WithCheckpointRW includes the rw in the checkpoint
|
||||
func WithCheckpointRW(ctx context.Context, client *Client, c *containers.Container, index *imagespec.Index, copts *options.CheckpointOptions) error {
|
||||
diffOpts := []diff.Opt{
|
||||
diff.WithReference(fmt.Sprintf("checkpoint-rw-%s", c.SnapshotKey)),
|
||||
diff.WithReference("checkpoint-rw-" + c.SnapshotKey),
|
||||
}
|
||||
rw, err := rootfs.CreateDiff(ctx,
|
||||
c.SnapshotKey,
|
||||
|
||||
+2
-2
@@ -389,11 +389,11 @@ func (i *image) Unpack(ctx context.Context, snapshotterName string, opts ...Unpa
|
||||
cinfo := content.Info{
|
||||
Digest: desc.Digest,
|
||||
Labels: map[string]string{
|
||||
fmt.Sprintf("containerd.io/gc.ref.snapshot.%s", snapshotterName): rootFS,
|
||||
"containerd.io/gc.ref.snapshot." + snapshotterName: rootFS,
|
||||
},
|
||||
}
|
||||
|
||||
_, err = cs.Update(ctx, cinfo, fmt.Sprintf("labels.containerd.io/gc.ref.snapshot.%s", snapshotterName))
|
||||
_, err = cs.Update(ctx, cinfo, "labels.containerd.io/gc.ref.snapshot."+snapshotterName)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ package client
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"slices"
|
||||
|
||||
@@ -108,7 +109,7 @@ func resolveSnapshotOptions(ctx context.Context, client *Client, snapshotterName
|
||||
}
|
||||
|
||||
if _, err := rsn.IDMap.RootPair(); err != nil {
|
||||
return "", fmt.Errorf("container UID/GID mapping entries of 0 are required but not found")
|
||||
return "", errors.New("container UID/GID mapping entries of 0 are required but not found")
|
||||
}
|
||||
|
||||
usernsID, err := rsn.ID()
|
||||
|
||||
+2
-2
@@ -751,7 +751,7 @@ func (t *task) checkpointTask(ctx context.Context, index *v1.Index, request *tas
|
||||
|
||||
func (t *task) checkpointRWSnapshot(ctx context.Context, index *v1.Index, snapshotterName string, id string) error {
|
||||
opts := []diff.Opt{
|
||||
diff.WithReference(fmt.Sprintf("checkpoint-rw-%s", id)),
|
||||
diff.WithReference("checkpoint-rw-" + id),
|
||||
}
|
||||
rw, err := rootfs.CreateDiff(ctx, id, t.client.SnapshotService(snapshotterName), t.client.DiffService(), opts...)
|
||||
if err != nil {
|
||||
@@ -767,7 +767,7 @@ func (t *task) checkpointRWSnapshot(ctx context.Context, index *v1.Index, snapsh
|
||||
|
||||
func (t *task) checkpointImage(ctx context.Context, index *v1.Index, image string) error {
|
||||
if image == "" {
|
||||
return fmt.Errorf("cannot checkpoint image with empty name")
|
||||
return errors.New("cannot checkpoint image with empty name")
|
||||
}
|
||||
ir, err := t.client.ImageService().Get(ctx, image)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user