mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
daemon: replace uses of errdefs package
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
@@ -17,7 +17,6 @@ import (
|
||||
containertypes "github.com/docker/docker/api/types/container"
|
||||
"github.com/docker/docker/api/types/system"
|
||||
"github.com/docker/docker/daemon/config"
|
||||
"github.com/docker/docker/errdefs"
|
||||
"github.com/docker/docker/pkg/rootless"
|
||||
"github.com/docker/docker/pkg/sysinfo"
|
||||
"github.com/pkg/errors"
|
||||
@@ -180,7 +179,7 @@ func (daemon *Daemon) fillPlatformVersion(ctx context.Context, v *types.Version,
|
||||
}
|
||||
|
||||
if err := daemon.fillRootlessVersion(ctx, v); err != nil {
|
||||
if errdefs.IsContext(err) {
|
||||
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
|
||||
return err
|
||||
}
|
||||
log.G(ctx).WithError(err).Warn("Failed to fill rootless version")
|
||||
@@ -207,7 +206,7 @@ func (daemon *Daemon) populateInitCommit(ctx context.Context, v *system.Info, cf
|
||||
|
||||
rv, err := exec.CommandContext(ctx, initBinary, "--version").Output()
|
||||
if err != nil {
|
||||
if errdefs.IsContext(err) {
|
||||
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
|
||||
return err
|
||||
}
|
||||
log.G(ctx).WithError(err).Warnf("Failed to retrieve %s version", initBinary)
|
||||
@@ -262,7 +261,7 @@ func (daemon *Daemon) fillRootlessVersion(ctx context.Context, v *types.Version)
|
||||
err = func() error {
|
||||
rv, err := exec.CommandContext(ctx, "slirp4netns", "--version").Output()
|
||||
if err != nil {
|
||||
if errdefs.IsContext(err) {
|
||||
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
|
||||
return err
|
||||
}
|
||||
log.G(ctx).WithError(err).Warn("Failed to retrieve slirp4netns version")
|
||||
@@ -290,7 +289,7 @@ func (daemon *Daemon) fillRootlessVersion(ctx context.Context, v *types.Version)
|
||||
err = func() error {
|
||||
out, err := exec.CommandContext(ctx, "vpnkit", "--version").Output()
|
||||
if err != nil {
|
||||
if errdefs.IsContext(err) {
|
||||
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
|
||||
return err
|
||||
}
|
||||
log.G(ctx).WithError(err).Warn("Failed to retrieve vpnkit version")
|
||||
@@ -426,7 +425,7 @@ func noNewPrivileges(cfg *config.Config) bool {
|
||||
func (daemon *Daemon) populateContainerdCommit(ctx context.Context, v *system.Commit) error {
|
||||
rv, err := daemon.containerd.Version(ctx)
|
||||
if err != nil {
|
||||
if errdefs.IsContext(err) {
|
||||
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
|
||||
return err
|
||||
}
|
||||
log.G(ctx).WithError(err).Warnf("Failed to retrieve containerd version")
|
||||
@@ -439,7 +438,7 @@ func (daemon *Daemon) populateContainerdCommit(ctx context.Context, v *system.Co
|
||||
func (daemon *Daemon) populateContainerdVersion(ctx context.Context, v *types.Version) error {
|
||||
rv, err := daemon.containerd.Version(ctx)
|
||||
if err != nil {
|
||||
if errdefs.IsContext(err) {
|
||||
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
|
||||
return err
|
||||
}
|
||||
log.G(ctx).WithError(err).Warn("Failed to retrieve containerd version")
|
||||
@@ -480,7 +479,7 @@ func populateInitVersion(ctx context.Context, cfg *configStore, v *types.Version
|
||||
|
||||
rv, err := exec.CommandContext(ctx, initBinary, "--version").Output()
|
||||
if err != nil {
|
||||
if errdefs.IsContext(err) {
|
||||
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
|
||||
return err
|
||||
}
|
||||
log.G(ctx).WithError(err).Warnf("Failed to retrieve %s version", initBinary)
|
||||
|
||||
Reference in New Issue
Block a user