mirror of
https://github.com/containers/podman.git
synced 2025-06-20 00:51:16 +08:00
Remove --net flag and make it an alias for --network
Signed-off-by: Matthew Heon <mheon@redhat.com> Closes: #862 Approved by: rhatdan
This commit is contained in:
@ -270,12 +270,7 @@ var createFlags = []cli.Flag{
|
|||||||
Usage: "Assign a name to the container",
|
Usage: "Assign a name to the container",
|
||||||
},
|
},
|
||||||
cli.StringFlag{
|
cli.StringFlag{
|
||||||
Name: "net",
|
Name: "net, network",
|
||||||
Usage: "Connect a container to a network (alias for --network)",
|
|
||||||
Value: "bridge",
|
|
||||||
},
|
|
||||||
cli.StringFlag{
|
|
||||||
Name: "network",
|
|
||||||
Usage: "Connect a container to a network",
|
Usage: "Connect a container to a network",
|
||||||
Value: "bridge",
|
Value: "bridge",
|
||||||
},
|
},
|
||||||
|
@ -424,12 +424,6 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim
|
|||||||
return nil, errors.Wrapf(err, "unable to translate --shm-size")
|
return nil, errors.Wrapf(err, "unable to translate --shm-size")
|
||||||
}
|
}
|
||||||
// Network
|
// Network
|
||||||
// Both --network and --net have default values of 'bridge'
|
|
||||||
// --net only overrides --network when --network is not explicitly
|
|
||||||
// set and --net is.
|
|
||||||
if c.IsSet("network") && c.IsSet("net") {
|
|
||||||
return nil, errors.Errorf("cannot use --network and --net together. use only --network instead")
|
|
||||||
}
|
|
||||||
netMode := container.NetworkMode(c.String("network"))
|
netMode := container.NetworkMode(c.String("network"))
|
||||||
// Make sure if network is set to container namespace, port binding is not also being asked for
|
// Make sure if network is set to container namespace, port binding is not also being asked for
|
||||||
if netMode.IsContainer() {
|
if netMode.IsContainer() {
|
||||||
|
Reference in New Issue
Block a user