Merge pull request #16336 from rhatdan/VENDOR

Do not report that /usr/share/containers/storage.conf has been edited.
This commit is contained in:
OpenShift Merge Robot
2022-10-31 09:42:08 -04:00
committed by GitHub
8 changed files with 23 additions and 16 deletions

View File

@ -14,6 +14,7 @@ import (
"github.com/containers/podman/v4/pkg/rootless"
"github.com/containers/podman/v4/pkg/util"
"github.com/containers/storage"
stypes "github.com/containers/storage/types"
"github.com/sirupsen/logrus"
)
@ -215,9 +216,14 @@ func (r *Runtime) reset(ctx context.Context) error {
}
}
if storageConfPath, err := storage.DefaultConfigFile(rootless.IsRootless()); err == nil {
if _, err = os.Stat(storageConfPath); err == nil {
fmt.Printf("A storage.conf file exists at %s\n", storageConfPath)
fmt.Println("You should remove this file if you did not modify the configuration.")
switch storageConfPath {
case stypes.SystemConfigFile:
break
default:
if _, err = os.Stat(storageConfPath); err == nil {
fmt.Printf(" A %q config file exists.\n", storageConfPath)
fmt.Println("Remove this file if you did not modify the configuration.")
}
}
} else {
if prevError != nil {