mirror of
https://github.com/containers/podman.git
synced 2025-12-08 06:39:05 +08:00
Functionality changes to the following flags
--group-add --blkio-weight-device --device-read-bps --device-write-bps --device-read-iops --device-write-iops --group-add now supports group names as well as the gid associated with them. All the --device flags work now with moderate changes to the code to support both bps and iops. Added tests for all the flags. Signed-off-by: umohnani8 <umohnani@redhat.com> Closes: #590 Approved by: mheon
This commit is contained in:
@@ -86,7 +86,7 @@ type createConfig struct {
|
||||
Entrypoint []string //entrypoint
|
||||
Env map[string]string //env
|
||||
ExposedPorts map[nat.Port]struct{}
|
||||
GroupAdd []uint32 // group-add
|
||||
GroupAdd []string // group-add
|
||||
HostAdd []string //add-host
|
||||
Hostname string //hostname
|
||||
Image string
|
||||
@@ -208,6 +208,7 @@ func createCmd(c *cli.Context) error {
|
||||
options = append(options, libpod.WithUser(createConfig.User))
|
||||
options = append(options, libpod.WithShmDir(createConfig.ShmDir))
|
||||
options = append(options, libpod.WithShmSize(createConfig.Resources.ShmSize))
|
||||
options = append(options, libpod.WithGroups(createConfig.GroupAdd))
|
||||
ctr, err := runtime.NewContainer(runtimeSpec, options...)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -406,11 +407,6 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime, imageName string,
|
||||
return nil, errors.Wrapf(err, "invalid value for sysctl")
|
||||
}
|
||||
|
||||
groupAdd, err := stringSlicetoUint32Slice(c.StringSlice("group-add"))
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "invalid value for groups provided")
|
||||
}
|
||||
|
||||
if c.String("memory") != "" {
|
||||
memoryLimit, err = units.RAMInBytes(c.String("memory"))
|
||||
if err != nil {
|
||||
@@ -625,7 +621,7 @@ func parseCreateOpts(c *cli.Context, runtime *libpod.Runtime, imageName string,
|
||||
Entrypoint: entrypoint,
|
||||
Env: env,
|
||||
//ExposedPorts: ports,
|
||||
GroupAdd: groupAdd,
|
||||
GroupAdd: c.StringSlice("group-add"),
|
||||
Hostname: c.String("hostname"),
|
||||
HostAdd: c.StringSlice("add-host"),
|
||||
Image: imageName,
|
||||
|
||||
Reference in New Issue
Block a user