summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-12-02 01:01:09 +0100
committerGitHub <noreply@github.com>2020-12-02 01:01:09 +0100
commitc585012db395e259b13157a685d7f9596c0b9f7d (patch)
tree260a3d2e2b20af7f91cad8443278f53288b0c42d /cmd/podman
parentb2cd6e0402bcd425130e397d79588dc406eccf53 (diff)
parentdb70e91bde90514ace510f66a1069207217a8d69 (diff)
downloadpodman-c585012db395e259b13157a685d7f9596c0b9f7d.tar.gz
podman-c585012db395e259b13157a685d7f9596c0b9f7d.tar.bz2
podman-c585012db395e259b13157a685d7f9596c0b9f7d.zip
Merge pull request #8457 from afbjorklund/bridge-mtu
Add podman network create flag for bridge mtu
Diffstat (limited to 'cmd/podman')
-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