summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-07 13:13:38 +0200
committerGitHub <noreply@github.com>2021-09-07 13:13:38 +0200
commit6e3a2d3ecacc70b27cc29fbf3e7f93494cdc97a4 (patch)
tree7e1d51e2924fcf496756b354a26d234a2802190e /cmd
parent668deb2ff1cb918ec787e4c1de3a7c321b0def0b (diff)
parent3d02cfb5e05e14050f47ee446d3ed23d0948b90c (diff)
downloadpodman-6e3a2d3ecacc70b27cc29fbf3e7f93494cdc97a4.tar.gz
podman-6e3a2d3ecacc70b27cc29fbf3e7f93494cdc97a4.tar.bz2
podman-6e3a2d3ecacc70b27cc29fbf3e7f93494cdc97a4.zip
Merge pull request #11402 from Luap99/macvlan-doc
network create: add warning for deprecated macvlan flag
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/networks/create.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/cmd/podman/networks/create.go b/cmd/podman/networks/create.go
index 1f3b321ba..b5ddd215f 100644
--- a/cmd/podman/networks/create.go
+++ b/cmd/podman/networks/create.go
@@ -11,6 +11,7 @@ import (
"github.com/containers/podman/v3/libpod/define"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/pkg/errors"
+ "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
@@ -56,7 +57,8 @@ func networkCreateFlags(cmd *cobra.Command) {
macvlanFlagName := "macvlan"
flags.StringVar(&networkCreateOptions.MacVLAN, macvlanFlagName, "", "create a Macvlan connection based on this device")
- _ = cmd.RegisterFlagCompletionFunc(macvlanFlagName, completion.AutocompleteNone)
+ // This option is deprecated
+ flags.MarkHidden(macvlanFlagName)
labelFlagName := "label"
flags.StringArrayVar(&labels, labelFlagName, nil, "set metadata on a network")
@@ -100,6 +102,11 @@ func networkCreate(cmd *cobra.Command, args []string) error {
if err != nil {
return errors.Wrapf(err, "unable to process options")
}
+
+ if networkCreateOptions.MacVLAN != "" {
+ logrus.Warn("The --macvlan option is deprecated, use `--driver macvlan --opt parent=<device>` instead")
+ }
+
response, err := registry.ContainerEngine().NetworkCreate(registry.Context(), name, networkCreateOptions)
if err != nil {
return err