summaryrefslogtreecommitdiff
path: root/libpod/runtime.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-08-24 14:48:49 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-24 18:56:19 +0000
commit3473701de201dc2d5c24643eca392f0a3236f1bc (patch)
tree82f78a9b4ebef3afc8cb1fd5c936c7bfb3a19120 /libpod/runtime.go
parentfacdfbc596ccc279755091b3408e83f0db26d536 (diff)
downloadpodman-3473701de201dc2d5c24643eca392f0a3236f1bc.tar.gz
podman-3473701de201dc2d5c24643eca392f0a3236f1bc.tar.bz2
podman-3473701de201dc2d5c24643eca392f0a3236f1bc.zip
rootless: allow to override policy.json by the user
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #1336 Approved by: mheon
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r--libpod/runtime.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go
index 87b2d10a2..adeb901f2 100644
--- a/libpod/runtime.go
+++ b/libpod/runtime.go
@@ -263,7 +263,14 @@ func NewRuntime(options ...RuntimeOption) (runtime *Runtime, err error) {
configPath := ConfigPath
foundConfig := true
if rootless.IsRootless() {
- configPath = filepath.Join(os.Getenv("HOME"), ".config/containers/libpod.conf")
+ home := os.Getenv("HOME")
+ if runtime.config.SignaturePolicyPath == "" {
+ newPath := filepath.Join(home, ".config/containers/policy.json")
+ if _, err := os.Stat(newPath); err == nil {
+ runtime.config.SignaturePolicyPath = newPath
+ }
+ }
+ configPath = filepath.Join(home, ".config/containers/libpod.conf")
if _, err := os.Stat(configPath); err != nil {
foundConfig = false
}