mirror of
https://github.com/containerd/containerd.git
synced 2026-06-24 08:48:48 +00:00
fix: ST1005: error strings should not end with punctuation or newlines
Signed-off-by: yashsingh74 <yashsingh1774@gmail.com>
(cherry picked from commit b3eec6d8e9)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
committed by
Sebastiaan van Stijn
parent
1852b5d07e
commit
cebb3583e1
@@ -128,7 +128,7 @@ func NewContainer(ctx context.Context, client *containerd.Client, cliContext *cl
|
||||
opts = append(opts, oci.WithTTYSize(int(size.Width), int(size.Height)))
|
||||
}
|
||||
if cliContext.Bool("net-host") {
|
||||
return nil, errors.New("Cannot use host mode networking with Windows containers")
|
||||
return nil, errors.New("cannot use host mode networking with Windows containers")
|
||||
}
|
||||
if cliContext.Bool("cni") {
|
||||
ns, err := netns.NewNetNS("")
|
||||
|
||||
@@ -95,16 +95,16 @@ func IDMapMountWithAttrs(source, target string, usernsFd int, attrSet uint64, at
|
||||
|
||||
dFd, err := unix.OpenTree(-int(unix.EBADF), source, uint(unix.OPEN_TREE_CLONE|unix.OPEN_TREE_CLOEXEC|unix.AT_EMPTY_PATH))
|
||||
if err != nil {
|
||||
return fmt.Errorf("Unable to open tree for %s: %w", target, err)
|
||||
return fmt.Errorf("unable to open tree for %s: %w", target, err)
|
||||
}
|
||||
|
||||
defer unix.Close(dFd)
|
||||
if err = unix.MountSetattr(dFd, "", unix.AT_EMPTY_PATH, &attr); err != nil {
|
||||
return fmt.Errorf("Unable to shift GID/UID or set mount attrs for %s: %w", target, err)
|
||||
return fmt.Errorf("unable to shift GID/UID or set mount attrs for %s: %w", target, err)
|
||||
}
|
||||
|
||||
if err = unix.MoveMount(dFd, "", -int(unix.EBADF), target, unix.MOVE_MOUNT_F_EMPTY_PATH); err != nil {
|
||||
return fmt.Errorf("Unable to attach mount tree to %s: %w", target, err)
|
||||
return fmt.Errorf("unable to attach mount tree to %s: %w", target, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ func parseEndpoint(endpoint string) (string, string, error) {
|
||||
}
|
||||
return "npipe", fmt.Sprintf("//%s%s", host, u.Path), nil
|
||||
case "":
|
||||
return "", "", fmt.Errorf("Using %q as endpoint is deprecated, please consider using full url format", endpoint)
|
||||
return "", "", fmt.Errorf("using %q as endpoint is deprecated, please consider using full url format", endpoint)
|
||||
}
|
||||
return u.Scheme, "", fmt.Errorf("protocol %q not supported", u.Scheme)
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ func WithoutNamespace(t runtimespec.LinuxNamespaceType) oci.SpecOpts {
|
||||
func WithNamespacePath(t runtimespec.LinuxNamespaceType, nsPath string) oci.SpecOpts {
|
||||
return func(ctx context.Context, client oci.Client, c *containers.Container, s *runtimespec.Spec) error {
|
||||
if s.Linux == nil {
|
||||
return fmt.Errorf("Linux spec is required")
|
||||
return fmt.Errorf("linux spec is required")
|
||||
}
|
||||
|
||||
for i, ns := range s.Linux.Namespaces {
|
||||
|
||||
@@ -361,7 +361,7 @@ func mountPairToLayerStack(lower, upper []mount.Mount) ([]string, error) {
|
||||
// May return an ErrNotImplemented, which will fall back to LCOW
|
||||
upperLayer, upperParentLayerPaths, err := mountsToLayerAndParents(upper)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Upper mount invalid: %w", err)
|
||||
return nil, fmt.Errorf("upper mount invalid: %w", err)
|
||||
}
|
||||
|
||||
lowerLayer, lowerParentLayerPaths, err := mountsToLayerAndParents(lower)
|
||||
@@ -369,7 +369,7 @@ func mountPairToLayerStack(lower, upper []mount.Mount) ([]string, error) {
|
||||
// Upper was a windows-layer, lower is not. We can't handle that.
|
||||
return nil, fmt.Errorf("windowsDiff cannot diff a windows-layer against a non-windows-layer: %w", errdefs.ErrInvalidArgument)
|
||||
} else if err != nil {
|
||||
return nil, fmt.Errorf("Lower mount invalid: %w", err)
|
||||
return nil, fmt.Errorf("lower mount invalid: %w", err)
|
||||
}
|
||||
|
||||
// Trivial case, diff-against-nothing
|
||||
|
||||
Reference in New Issue
Block a user