aboutsummaryrefslogtreecommitdiff
path: root/cmd/podman/networks
diff options
context:
space:
mode:
authorAnders F Björklund <anders.f.bjorklund@gmail.com>2020-11-23 22:04:06 +0100
committerAnders F Björklund <anders.f.bjorklund@gmail.com>2020-12-01 22:33:03 +0100
commitb1b35707aae57d299933f029eb0adc0a9000f97f (patch)
tree52c70c05c8cd7374d344d289a35323a8587cce88 /cmd/podman/networks
parentc71ad9a557ee80eccde2608939c81906379fa7ae (diff)
downloadpodman-b1b35707aae57d299933f029eb0adc0a9000f97f.tar.gz
podman-b1b35707aae57d299933f029eb0adc0a9000f97f.tar.bz2
podman-b1b35707aae57d299933f029eb0adc0a9000f97f.zip
Add podman network create option for bridge mtu
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
Diffstat (limited to 'cmd/podman/networks')
-rw-r--r--cmd/podman/networks/create.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/podman/networks/create.go b/cmd/podman/networks/create.go
index 938b8da77..8db4bb89a 100644
--- a/cmd/podman/networks/create.go
+++ b/cmd/podman/networks/create.go
@@ -30,6 +30,7 @@ var (
var (
networkCreateOptions entities.NetworkCreateOptions
labels []string
+ opts []string
)
func networkCreateFlags(cmd *cobra.Command) {
@@ -39,6 +40,10 @@ func networkCreateFlags(cmd *cobra.Command) {
flags.StringVarP(&networkCreateOptions.Driver, driverFlagName, "d", "bridge", "driver to manage the network")
_ = cmd.RegisterFlagCompletionFunc(driverFlagName, common.AutocompleteNetworkDriver)
+ optFlagName := "opt"
+ flags.StringArrayVarP(&opts, optFlagName, "o", []string{}, "Set driver specific options (default [])")
+ _ = cmd.RegisterFlagCompletionFunc(optFlagName, completion.AutocompleteNone)
+
gatewayFlagName := "gateway"
flags.IPVar(&networkCreateOptions.Gateway, gatewayFlagName, nil, "IPv4 or IPv6 gateway for the subnet")
_ = cmd.RegisterFlagCompletionFunc(gatewayFlagName, completion.AutocompleteNone)
@@ -93,6 +98,10 @@ func networkCreate(cmd *cobra.Command, args []string) error {
if err != nil {
return errors.Wrap(err, "failed to parse labels")
}
+ networkCreateOptions.Options, err = parse.GetAllLabels([]string{}, opts)
+ if err != nil {
+ return errors.Wrapf(err, "unable to process options")
+ }
response, err := registry.ContainerEngine().NetworkCreate(registry.Context(), name, networkCreateOptions)
if err != nil {
return err