Remove --namespace flag from Podman root

Signed-off-by: Matt Heon <mheon@redhat.com>
This commit is contained in:
Matt Heon
2023-02-21 10:30:28 -05:00
parent 89d0ccd195
commit c4fe0af2aa
4 changed files with 3 additions and 7 deletions

View File

@ -457,6 +457,7 @@ func rootFlags(cmd *cobra.Command, podmanConfig *entities.PodmanConfig) {
namespaceFlagName := "namespace" namespaceFlagName := "namespace"
pFlags.StringVar(&podmanConfig.ContainersConf.Engine.Namespace, namespaceFlagName, podmanConfig.ContainersConfDefaultsRO.Engine.Namespace, "Set the libpod namespace, used to create separate views of the containers and pods on the system") pFlags.StringVar(&podmanConfig.ContainersConf.Engine.Namespace, namespaceFlagName, podmanConfig.ContainersConfDefaultsRO.Engine.Namespace, "Set the libpod namespace, used to create separate views of the containers and pods on the system")
_ = cmd.RegisterFlagCompletionFunc(namespaceFlagName, completion.AutocompleteNone) _ = cmd.RegisterFlagCompletionFunc(namespaceFlagName, completion.AutocompleteNone)
_ = pFlags.MarkHidden(namespaceFlagName)
networkBackendFlagName := "network-backend" networkBackendFlagName := "network-backend"
pFlags.StringVar(&podmanConfig.ContainersConf.Network.NetworkBackend, networkBackendFlagName, podmanConfig.ContainersConfDefaultsRO.Network.NetworkBackend, `Network backend to use ("cni"|"netavark")`) pFlags.StringVar(&podmanConfig.ContainersConf.Network.NetworkBackend, networkBackendFlagName, podmanConfig.ContainersConfDefaultsRO.Network.NetworkBackend, `Network backend to use ("cni"|"netavark")`)

View File

@ -82,11 +82,6 @@ Remote connections use local containers.conf for default.
Log messages at and above specified level: debug, info, warn, error, fatal or panic (default: "warn") Log messages at and above specified level: debug, info, warn, error, fatal or panic (default: "warn")
#### **--namespace**=*namespace*
Set libpod namespace. Namespaces are used to separate groups of containers and pods in libpod's state.
When namespace is set, created containers and pods will join the given namespace, and only containers and pods in the given namespace will be visible to Podman.
#### **--network-cmd-path**=*path* #### **--network-cmd-path**=*path*
Path to the command binary to use for setting up a network. It is currently only used for setting up a slirp4netns(1) or pasta(1) network. If "" is used then the binary is looked up using the $PATH environment variable. Path to the command binary to use for setting up a network. It is currently only used for setting up a slirp4netns(1) or pasta(1) network. If "" is used then the binary is looked up using the $PATH environment variable.

View File

@ -541,7 +541,7 @@ func (s *BoltState) GetContainerName(id string) (string, error) {
} }
// GetPodName returns the name associated with a given ID. // GetPodName returns the name associated with a given ID.
// Returns ErrNoSuchPor if the ID does not exist. // Returns ErrNoSuchPod if the ID does not exist.
func (s *BoltState) GetPodName(id string) (string, error) { func (s *BoltState) GetPodName(id string) (string, error) {
if id == "" { if id == "" {
return "", define.ErrEmptyID return "", define.ErrEmptyID

View File

@ -428,7 +428,7 @@ func makeRuntime(runtime *Runtime) (retErr error) {
} }
if runtime.config.Engine.Namespace != "" { if runtime.config.Engine.Namespace != "" {
return fmt.Errorf("namespaces are not supported by this version of Libpod: %w", define.ErrNotImplemented) return fmt.Errorf("namespaces are not supported by this version of Libpod, please unset the `namespace` field in containers.conf: %w", define.ErrNotImplemented)
} }
needsUserns := os.Geteuid() != 0 needsUserns := os.Geteuid() != 0