@@ -396,7 +396,7 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
396396
397397 // Can't evaluate options passed into --tmpfs until we actually mount
398398 tmpfs := make (map [string ]string )
399- for _ , t := range copts .tmpfs .GetAll () {
399+ for _ , t := range copts .tmpfs .GetSlice () {
400400 k , v , _ := strings .Cut (t , ":" )
401401 tmpfs [k ] = v
402402 }
@@ -417,7 +417,7 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
417417 entrypoint = []string {"" }
418418 }
419419
420- publishOpts := copts .publish .GetAll ()
420+ publishOpts := copts .publish .GetSlice ()
421421 var (
422422 ports map [nat.Port ]struct {}
423423 portBindings map [nat.Port ][]nat.PortBinding
@@ -435,7 +435,7 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
435435 }
436436
437437 // Merge in exposed ports to the map of published ports
438- for _ , e := range copts .expose .GetAll () {
438+ for _ , e := range copts .expose .GetSlice () {
439439 if strings .Contains (e , ":" ) {
440440 return nil , errors .Errorf ("invalid port format for --expose: %s" , e )
441441 }
@@ -465,7 +465,7 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
465465 // what operating system it is.
466466 deviceMappings := []container.DeviceMapping {}
467467 var cdiDeviceNames []string
468- for _ , device := range copts .devices .GetAll () {
468+ for _ , device := range copts .devices .GetSlice () {
469469 var (
470470 validated string
471471 deviceMapping container.DeviceMapping
@@ -487,13 +487,13 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
487487 }
488488
489489 // collect all the environment variables for the container
490- envVariables , err := opts .ReadKVEnvStrings (copts .envFile .GetAll (), copts .env .GetAll ())
490+ envVariables , err := opts .ReadKVEnvStrings (copts .envFile .GetSlice (), copts .env .GetSlice ())
491491 if err != nil {
492492 return nil , err
493493 }
494494
495495 // collect all the labels for the container
496- labels , err := opts .ReadKVStrings (copts .labelsFile .GetAll (), copts .labels .GetAll ())
496+ labels , err := opts .ReadKVStrings (copts .labelsFile .GetSlice (), copts .labels .GetSlice ())
497497 if err != nil {
498498 return nil , err
499499 }
@@ -523,19 +523,19 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
523523 return nil , err
524524 }
525525
526- loggingOpts , err := parseLoggingOpts (copts .loggingDriver , copts .loggingOpts .GetAll ())
526+ loggingOpts , err := parseLoggingOpts (copts .loggingDriver , copts .loggingOpts .GetSlice ())
527527 if err != nil {
528528 return nil , err
529529 }
530530
531- securityOpts , err := parseSecurityOpts (copts .securityOpt .GetAll ())
531+ securityOpts , err := parseSecurityOpts (copts .securityOpt .GetSlice ())
532532 if err != nil {
533533 return nil , err
534534 }
535535
536536 securityOpts , maskedPaths , readonlyPaths := parseSystemPaths (securityOpts )
537537
538- storageOpts , err := parseStorageOpts (copts .storageOpt .GetAll ())
538+ storageOpts , err := parseStorageOpts (copts .storageOpt .GetSlice ())
539539 if err != nil {
540540 return nil , err
541541 }
@@ -621,7 +621,7 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
621621 IOMaximumIOps : copts .ioMaxIOps ,
622622 IOMaximumBandwidth : uint64 (copts .ioMaxBandwidth ),
623623 Ulimits : copts .ulimits .GetList (),
624- DeviceCgroupRules : copts .deviceCgroupRules .GetAll (),
624+ DeviceCgroupRules : copts .deviceCgroupRules .GetSlice (),
625625 Devices : deviceMappings ,
626626 DeviceRequests : deviceRequests ,
627627 }
@@ -658,7 +658,7 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
658658 AutoRemove : copts .autoRemove ,
659659 Privileged : copts .privileged ,
660660 PortBindings : portBindings ,
661- Links : copts .links .GetAll (),
661+ Links : copts .links .GetSlice (),
662662 PublishAllPorts : copts .publishAll ,
663663 // Make sure the dns fields are never nil.
664664 // New containers don't ever have those fields nil,
@@ -668,17 +668,17 @@ func parse(flags *pflag.FlagSet, copts *containerOptions, serverOS string) (*con
668668 DNS : copts .dns .GetAllOrEmpty (),
669669 DNSSearch : copts .dnsSearch .GetAllOrEmpty (),
670670 DNSOptions : copts .dnsOptions .GetAllOrEmpty (),
671- ExtraHosts : copts .extraHosts .GetAll (),
672- VolumesFrom : copts .volumesFrom .GetAll (),
671+ ExtraHosts : copts .extraHosts .GetSlice (),
672+ VolumesFrom : copts .volumesFrom .GetSlice (),
673673 IpcMode : container .IpcMode (copts .ipcMode ),
674674 NetworkMode : container .NetworkMode (copts .netMode .NetworkMode ()),
675675 PidMode : pidMode ,
676676 UTSMode : utsMode ,
677677 UsernsMode : usernsMode ,
678678 CgroupnsMode : cgroupnsMode ,
679- CapAdd : strslice .StrSlice (copts .capAdd .GetAll ()),
680- CapDrop : strslice .StrSlice (copts .capDrop .GetAll ()),
681- GroupAdd : copts .groupAdd .GetAll (),
679+ CapAdd : strslice .StrSlice (copts .capAdd .GetSlice ()),
680+ CapDrop : strslice .StrSlice (copts .capDrop .GetSlice ()),
681+ GroupAdd : copts .groupAdd .GetSlice (),
682682 RestartPolicy : restartPolicy ,
683683 SecurityOpt : securityOpts ,
684684 StorageOpt : storageOpts ,
@@ -822,13 +822,13 @@ func applyContainerOptions(n *opts.NetworkAttachmentOpts, copts *containerOption
822822 }
823823 if copts .aliases .Len () > 0 {
824824 n .Aliases = make ([]string , copts .aliases .Len ())
825- copy (n .Aliases , copts .aliases .GetAll ())
825+ copy (n .Aliases , copts .aliases .GetSlice ())
826826 }
827827 // For a user-defined network, "--link" is an endpoint option, it creates an alias. But,
828828 // for the default bridge it defines a legacy-link.
829829 if container .NetworkMode (n .Target ).IsUserDefined () && copts .links .Len () > 0 {
830830 n .Links = make ([]string , copts .links .Len ())
831- copy (n .Links , copts .links .GetAll ())
831+ copy (n .Links , copts .links .GetSlice ())
832832 }
833833 if copts .ipv4Address != "" {
834834 n .IPv4Address = copts .ipv4Address
@@ -841,7 +841,7 @@ func applyContainerOptions(n *opts.NetworkAttachmentOpts, copts *containerOption
841841 }
842842 if copts .linkLocalIPs .Len () > 0 {
843843 n .LinkLocalIPs = make ([]string , copts .linkLocalIPs .Len ())
844- copy (n .LinkLocalIPs , copts .linkLocalIPs .GetAll ())
844+ copy (n .LinkLocalIPs , copts .linkLocalIPs .GetSlice ())
845845 }
846846 return nil
847847}
0 commit comments