Skip to content

Commit

Permalink
Remove --namespace flag from Podman root
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Heon <mheon@redhat.com>
  • Loading branch information
mheon committed Feb 22, 2023
1 parent 89d0ccd commit c4fe0af
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions cmd/podman/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ func rootFlags(cmd *cobra.Command, podmanConfig *entities.PodmanConfig) {
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")
_ = cmd.RegisterFlagCompletionFunc(namespaceFlagName, completion.AutocompleteNone)
_ = pFlags.MarkHidden(namespaceFlagName)

networkBackendFlagName := "network-backend"
pFlags.StringVar(&podmanConfig.ContainersConf.Network.NetworkBackend, networkBackendFlagName, podmanConfig.ContainersConfDefaultsRO.Network.NetworkBackend, `Network backend to use ("cni"|"netavark")`)
Expand Down
5 changes: 0 additions & 5 deletions docs/source/markdown/podman.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -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")

#### **--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*
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.

Expand Down
2 changes: 1 addition & 1 deletion libpod/boltdb_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ func (s *BoltState) GetContainerName(id string) (string, error) {
}

// 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) {
if id == "" {
return "", define.ErrEmptyID
Expand Down
2 changes: 1 addition & 1 deletion libpod/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ func makeRuntime(runtime *Runtime) (retErr error) {
}

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
Expand Down

0 comments on commit c4fe0af

Please sign in to comment.