ソースを参照

Merge pull request #23024 from rhatdan/selinux

We need to relabel newly created container volumes
Brian Goff 9 年 前
コミット
6b4fd5f071
1 ファイル変更3 行追加0 行削除
  1. 3 0
      container/container_unix.go

+ 3 - 0
container/container_unix.go

@@ -199,6 +199,9 @@ func (container *Container) CopyImagePathContent(v volume.Volume, destination st
 			logrus.Warnf("error while unmounting volume %s: %v", v.Name(), err)
 			logrus.Warnf("error while unmounting volume %s: %v", v.Name(), err)
 		}
 		}
 	}()
 	}()
+	if err := label.Relabel(path, container.MountLabel, true); err != nil && err != syscall.ENOTSUP {
+		return err
+	}
 	return copyExistingContents(rootfs, path)
 	return copyExistingContents(rootfs, path)
 }
 }