summaryrefslogtreecommitdiff
path: root/cmd/podman/main_local.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-09-03 07:02:44 -0700
committerGitHub <noreply@github.com>2019-09-03 07:02:44 -0700
commita16f63e96e9993a1e2542b6f5c85903cc4659c6e (patch)
tree2704f163395e48b0aa781aec82fc272f31addb15 /cmd/podman/main_local.go
parentc03949986feffd489e6fd41538d6a5bda233e850 (diff)
parent1a24ac7ad63464817a1b3df46ab7da1c0be6c842 (diff)
downloadpodman-a16f63e96e9993a1e2542b6f5c85903cc4659c6e.tar.gz
podman-a16f63e96e9993a1e2542b6f5c85903cc4659c6e.tar.bz2
podman-a16f63e96e9993a1e2542b6f5c85903cc4659c6e.zip
Merge pull request #3926 from giuseppe/add-warning-mismatch-configuration
rootless: detect user namespace configuration changes
Diffstat (limited to 'cmd/podman/main_local.go')
-rw-r--r--cmd/podman/main_local.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/podman/main_local.go b/cmd/podman/main_local.go
index 648dc166e..0feba609b 100644
--- a/cmd/podman/main_local.go
+++ b/cmd/podman/main_local.go
@@ -120,6 +120,14 @@ func profileOff(cmd *cobra.Command) error {
}
func setupRootless(cmd *cobra.Command, args []string) error {
+ matches, err := rootless.ConfigurationMatches()
+ if err != nil {
+ return err
+ }
+ if !matches {
+ logrus.Warningf("the current user namespace doesn't match the configuration in /etc/subuid or /etc/subgid")
+ logrus.Warningf("you can use `%s system migrate` to recreate the user namespace and restart the containers", os.Args[0])
+ }
if os.Geteuid() == 0 || cmd == _searchCommand || cmd == _versionCommand || cmd == _mountCommand || cmd == _migrateCommand || strings.HasPrefix(cmd.Use, "help") {
return nil
}
@@ -140,7 +148,7 @@ func setupRootless(cmd *cobra.Command, args []string) error {
became, ret, err := rootless.TryJoinFromFilePaths("", false, []string{pausePidPath})
if err != nil {
logrus.Errorf("cannot join pause process. You may need to remove %s and stop all containers", pausePidPath)
- logrus.Errorf("you can use `%s system migrate` to recreate the pause process", os.Args[0])
+ logrus.Errorf("you can use `%s system migrate` to recreate the pause process and restart the containers", os.Args[0])
logrus.Errorf(err.Error())
os.Exit(1)
}