diff --git a/container/container_unix.go b/container/container_unix.go index 3fc6c91e72..e2c4f5a845 100644 --- a/container/container_unix.go +++ b/container/container_unix.go @@ -20,7 +20,6 @@ import ( "github.com/opencontainers/selinux/go-selinux/label" "github.com/pkg/errors" "github.com/sirupsen/logrus" - "golang.org/x/sys/unix" ) const ( @@ -147,7 +146,7 @@ func (container *Container) CopyImagePathContent(v volume.Volume, destination st logrus.Warnf("error while unmounting volume %s: %v", v.Name(), err) } }() - if err := label.Relabel(path, container.MountLabel, true); err != nil && err != unix.ENOTSUP { + if err := label.Relabel(path, container.MountLabel, true); err != nil && !errors.Is(err, syscall.ENOTSUP) { return err } return copyExistingContents(rootfs, path) diff --git a/volume/mounts/mounts.go b/volume/mounts/mounts.go index 5bf169f6e0..c441e51ed9 100644 --- a/volume/mounts/mounts.go +++ b/volume/mounts/mounts.go @@ -113,7 +113,7 @@ func (m *MountPoint) Setup(mountLabel string, rootIDs idtools.Identity, checkFun return } err = label.Relabel(sourcePath, mountLabel, label.IsShared(m.Mode)) - if err == syscall.ENOTSUP { + if errors.Is(err, syscall.ENOTSUP) { err = nil } if err != nil {