Sfoglia il codice sorgente

Merge pull request #21877 from AkihiroSuda/trivial-fix

oci: default devices don't need to be listed explicitly
David Calavera 9 anni fa
parent
commit
08e27a7148
1 ha cambiato i file con 4 aggiunte e 36 eliminazioni
  1. 4 36
      oci/defaults_linux.go

+ 4 - 36
oci/defaults_linux.go

@@ -99,43 +99,11 @@ func DefaultSpec() specs.Spec {
 			{Type: "pid"},
 			{Type: "pid"},
 			{Type: "ipc"},
 			{Type: "ipc"},
 		},
 		},
+		// Devices implicitly contains the following devices:
+		// null, zero, full, random, urandom, tty, console, and ptmx.
+		// ptmx is a bind-mount or symlink of the container's ptmx.
+		// See also: https://github.com/opencontainers/runtime-spec/blob/master/config-linux.md#default-devices
 		Devices: []specs.Device{
 		Devices: []specs.Device{
-			{
-				Type:     "c",
-				Path:     "/dev/zero",
-				Major:    1,
-				Minor:    5,
-				FileMode: fmPtr(0666),
-				UID:      u32Ptr(0),
-				GID:      u32Ptr(0),
-			},
-			{
-				Type:     "c",
-				Path:     "/dev/null",
-				Major:    1,
-				Minor:    3,
-				FileMode: fmPtr(0666),
-				UID:      u32Ptr(0),
-				GID:      u32Ptr(0),
-			},
-			{
-				Type:     "c",
-				Path:     "/dev/urandom",
-				Major:    1,
-				Minor:    9,
-				FileMode: fmPtr(0666),
-				UID:      u32Ptr(0),
-				GID:      u32Ptr(0),
-			},
-			{
-				Type:     "c",
-				Path:     "/dev/random",
-				Major:    1,
-				Minor:    8,
-				FileMode: fmPtr(0666),
-				UID:      u32Ptr(0),
-				GID:      u32Ptr(0),
-			},
 			{
 			{
 				Type:     "c",
 				Type:     "c",
 				Path:     "/dev/fuse",
 				Path:     "/dev/fuse",