summaryrefslogtreecommitdiff
path: root/cmd/podman
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-11-05 18:59:55 +0100
committerGitHub <noreply@github.com>2021-11-05 18:59:55 +0100
commite826158b4b9c4baef41ca872dea5e68e089355d3 (patch)
tree3fff45f85073bfda41adccf6e45a0ffd5fc44b91 /cmd/podman
parent9b3b44903d4d494186bd767d2ea5f3b2c753a7f2 (diff)
parent7f433df7e76716f801c959cad82f4add397d925a (diff)
downloadpodman-e826158b4b9c4baef41ca872dea5e68e089355d3.tar.gz
podman-e826158b4b9c4baef41ca872dea5e68e089355d3.tar.bz2
podman-e826158b4b9c4baef41ca872dea5e68e089355d3.zip
Merge pull request #12183 from Luap99/rootless-netns-cleanup
Fix rootless cni netns cleanup logic and rename to rootless netns
Diffstat (limited to 'cmd/podman')
-rw-r--r--cmd/podman/system/unshare.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/podman/system/unshare.go b/cmd/podman/system/unshare.go
index 50230609e..9b777dd8f 100644
--- a/cmd/podman/system/unshare.go
+++ b/cmd/podman/system/unshare.go
@@ -10,6 +10,7 @@ import (
"github.com/containers/podman/v3/pkg/rootless"
"github.com/pkg/errors"
"github.com/spf13/cobra"
+ "github.com/spf13/pflag"
)
var (
@@ -34,7 +35,14 @@ func init() {
})
flags := unshareCommand.Flags()
flags.SetInterspersed(false)
- flags.BoolVar(&unshareOptions.RootlessCNI, "rootless-cni", false, "Join the rootless network namespace used for CNI networking")
+ flags.BoolVar(&unshareOptions.RootlessNetNS, "rootless-netns", false, "Join the rootless network namespace used for CNI and netavark networking")
+ // backwards compat still allow --rootless-cni
+ flags.SetNormalizeFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName {
+ if name == "rootless-cni" {
+ name = "rootless-netns"
+ }
+ return pflag.NormalizedName(name)
+ })
}
func unshare(cmd *cobra.Command, args []string) error {