@@ -586,87 +586,3 @@ func addSeccomp(g *generate.Generator, context *cli.Context) error {
586586
587587 return nil
588588}
589-
590- func setupLinuxNamespaces (context * cli.Context , g * generate.Generator , needsNewUser bool ) {
591- for _ , nsName := range generate .Namespaces {
592- if ! context .IsSet (nsName ) && ! (needsNewUser && nsName == "user" ) {
593- continue
594- }
595- nsPath := context .String (nsName )
596- if nsPath == "host" {
597- g .RemoveLinuxNamespace (nsName )
598- continue
599- }
600- g .AddOrReplaceLinuxNamespace (nsName , nsPath )
601- }
602- }
603-
604- func parseIDMapping (idms string ) (uint32 , uint32 , uint32 , error ) {
605- idm := strings .Split (idms , ":" )
606- if len (idm ) != 3 {
607- return 0 , 0 , 0 , fmt .Errorf ("idmappings error: %s" , idms )
608- }
609-
610- hid , err := strconv .Atoi (idm [0 ])
611- if err != nil {
612- return 0 , 0 , 0 , err
613- }
614-
615- cid , err := strconv .Atoi (idm [1 ])
616- if err != nil {
617- return 0 , 0 , 0 , err
618- }
619-
620- size , err := strconv .Atoi (idm [2 ])
621- if err != nil {
622- return 0 , 0 , 0 , err
623- }
624-
625- return uint32 (hid ), uint32 (cid ), uint32 (size ), nil
626- }
627-
628- func parseHook (s string ) (string , []string ) {
629- parts := strings .Split (s , ":" )
630- args := []string {}
631- path := parts [0 ]
632- if len (parts ) > 1 {
633- args = parts [1 :]
634- }
635- return path , args
636- }
637-
638- func parseTmpfsMount (s string ) (string , []string , error ) {
639- var dest string
640- var options []string
641- var err error
642-
643- parts := strings .Split (s , ":" )
644- if len (parts ) == 2 {
645- dest = parts [0 ]
646- options = strings .Split (parts [1 ], "," )
647- } else if len (parts ) == 1 {
648- dest = parts [0 ]
649- options = []string {"rw" , "noexec" , "nosuid" , "nodev" , "size=65536k" }
650- } else {
651- err = fmt .Errorf ("invalid value for --tmpfs" )
652- }
653-
654- return dest , options , err
655- }
656-
657- func parseBindMount (s string ) (string , string , string , error ) {
658- var source , dest string
659- options := "ro"
660-
661- bparts := strings .SplitN (s , ":" , 3 )
662- switch len (bparts ) {
663- case 2 :
664- source , dest = bparts [0 ], bparts [1 ]
665- case 3 :
666- source , dest , options = bparts [0 ], bparts [1 ], bparts [2 ]
667- default :
668- return source , dest , options , fmt .Errorf ("--bind should have format src:dest:[options]" )
669- }
670-
671- return source , dest , options , nil
672- }
0 commit comments