summaryrefslogtreecommitdiff
path: root/volume/mounts
diff options
context:
space:
mode:
authorSebastiaan van Stijn <github@gone.nl>2020-05-10 16:19:42 +0200
committerSebastiaan van Stijn <github@gone.nl>2020-05-10 17:06:44 +0200
commit49f8a4224cc22f94169cfb70d30d8afffa2e319a (patch)
treec8de5732840912fad7174909205019a5b7a0c470 /volume/mounts
parent298ba5b13150bfffe8414922a951a7a793276d31 (diff)
downloaddocker-49f8a4224cc22f94169cfb70d30d8afffa2e319a.tar.gz
SELinux: fix ENOTSUP errors not being detected when relabeling
Commit 12c7541f1f2d616967f9eecce182789de7e2a238 updated the opencontainers/selinux dependency to v1.3.1, which had a breaking change in the errors that were returned. Before v1.3.1, the "raw" `syscall.ENOTSUP` was returned if the underlying filesystem did not support xattrs, but later versions wrapped the error, which caused our detection to fail. This patch uses `errors.Is()` to check for the underlying error. This requires github.com/pkg/errors v0.9.1 or above (older versions could use `errors.Cause()`, but are not compatible with "native" wrapping of errors in Go 1.13 and up, and could potentially cause these errors to not being detected again. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Diffstat (limited to 'volume/mounts')
-rw-r--r--volume/mounts/mounts.go2
1 files changed, 1 insertions, 1 deletions
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 {