mirror of
https://github.com/actions/runner.git
synced 2025-12-13 19:03:44 +00:00
Raise warning when volume mount root. (#413)
This commit is contained in:
@@ -180,6 +180,11 @@ namespace GitHub.Runner.Worker
|
|||||||
foreach (var volume in container.UserMountVolumes)
|
foreach (var volume in container.UserMountVolumes)
|
||||||
{
|
{
|
||||||
Trace.Info($"User provided volume: {volume.Value}");
|
Trace.Info($"User provided volume: {volume.Value}");
|
||||||
|
var mount = new MountVolume(volume.Value);
|
||||||
|
if (string.Equals(mount.SourceVolumePath, "/", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
executionContext.Warning($"Volume mount {volume.Value} is going to mount '/' into the container which may cause file ownership change in the entire file system and cause Actions Runner to lose permission to access the disk.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pull down docker image with retry up to 3 times
|
// Pull down docker image with retry up to 3 times
|
||||||
|
|||||||
Reference in New Issue
Block a user