Skip to content

Commit 58374ae

Browse files
author
Ma Shimiao
committed
remove --mount-cgroups option
Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
1 parent 74d6245 commit 58374ae

4 files changed

Lines changed: 0 additions & 38 deletions

File tree

cmd/oci-runtime-tool/generate.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ var generateFlags = []cli.Flag{
8080
cli.StringFlag{Name: "linux-selinux-label", Usage: "process selinux label"},
8181
cli.StringSliceFlag{Name: "linux-sysctl", Usage: "add sysctl settings e.g net.ipv4.forward=1"},
8282
cli.StringSliceFlag{Name: "linux-uidmappings", Usage: "add UIDMappings e.g HostID:ContainerID:Size"},
83-
cli.StringFlag{Name: "mount-cgroups", Value: "no", Usage: "mount cgroups (rw,ro,no)"},
8483
cli.StringSliceFlag{Name: "mounts-add", Usage: "configures additional mounts inside container"},
8584
cli.BoolFlag{Name: "mounts-remove-all", Usage: "remove all mounts inside container"},
8685
cli.StringFlag{Name: "output", Usage: "output file (defaults to stdout)"},
@@ -415,11 +414,6 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
415414
g.AddOrReplaceLinuxNamespace("user", "")
416415
}
417416

418-
mountCgroupOption := context.String("mount-cgroups")
419-
if err := g.AddCgroupsMount(mountCgroupOption); err != nil {
420-
return err
421-
}
422-
423417
if context.IsSet("mounts-remove-all") {
424418
g.ClearMounts()
425419
}

completions/bash/oci-runtime-tool

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,6 @@ _oci-runtime-tool_generate() {
360360
--linux-selinux-label
361361
--linux-sysctl
362362
--linux-uidmappings
363-
--mount-cgroups
364363
--mounts-add
365364
--output
366365
--process-cap-add-ambient
@@ -436,11 +435,6 @@ _oci-runtime-tool_generate() {
436435
return
437436
;;
438437

439-
--mount-cgroups)
440-
COMPREPLY=( $( compgen -W "no ro rw" -- "$cur" ) )
441-
return
442-
;;
443-
444438
--process-cap-add-ambient|--process-cap-add-bounding|--process-cap-add-effective|--process-cap-add-inheritable|--process-cap-add-permitted|--process-cap-drop-ambient|--process-cap-drop-bounding|--process-cap-drop-effective|--process-cap-drop-inheritable|--process-cap-drop-permitted)
445439
__oci-runtime-tool_complete_capabilities
446440
return

generate/generate.go

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -896,29 +896,6 @@ func (g *Generator) ClearMounts() {
896896
g.spec.Mounts = []rspec.Mount{}
897897
}
898898

899-
// AddCgroupsMount adds a cgroup mount into g.spec.Mounts.
900-
func (g *Generator) AddCgroupsMount(mountCgroupOption string) error {
901-
switch mountCgroupOption {
902-
case "ro":
903-
case "rw":
904-
case "no":
905-
return nil
906-
default:
907-
return fmt.Errorf("--mount-cgroups should be one of (ro,rw,no)")
908-
}
909-
910-
mnt := rspec.Mount{
911-
Destination: "/sys/fs/cgroup",
912-
Type: "cgroup",
913-
Source: "cgroup",
914-
Options: []string{"nosuid", "noexec", "nodev", "relatime", mountCgroupOption},
915-
}
916-
g.initSpec()
917-
g.spec.Mounts = append(g.spec.Mounts, mnt)
918-
919-
return nil
920-
}
921-
922899
// SetupPrivileged sets up the privilege-related fields inside g.spec.
923900
func (g *Generator) SetupPrivileged(privileged bool) {
924901
if privileged { // Add all capabilities in privileged mode.

man/oci-runtime-tool-generate.1.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,6 @@ read the configuration from `config.json`.
283283

284284
Add UIDMappings e.g HostUID:ContainerID:Size. Implies **--user=**.
285285

286-
**--mount-cgroups**=[rw|ro|no]
287-
Mount cgroups. The default is *no*.
288-
289286
**--mounts-add**=[]
290287
Configures additional mounts inside container.
291288
This option can be specified multiple times.

0 commit comments

Comments
 (0)