From 6502b1faa6fcc579eafff79f5e2e1183d7a23def Mon Sep 17 00:00:00 2001 From: Doug Rabson Date: Fri, 11 Nov 2022 11:33:20 +0000 Subject: [PATCH] pkg/trust: Take the default policy path from c/common/pkg/config This reduces the number of places default policy path is defined to two. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson --- pkg/trust/policy.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/trust/policy.go b/pkg/trust/policy.go index e0c5e06894..aa14fc7e15 100644 --- a/pkg/trust/policy.go +++ b/pkg/trust/policy.go @@ -12,6 +12,7 @@ import ( "path/filepath" "strings" + "github.com/containers/common/pkg/config" "github.com/containers/image/v5/types" "github.com/sirupsen/logrus" ) @@ -53,7 +54,7 @@ type genericRepoMap map[string]json.RawMessage // DefaultPolicyPath returns a path to the default policy of the system. func DefaultPolicyPath(sys *types.SystemContext) string { - systemDefaultPolicyPath := "/etc/containers/policy.json" + systemDefaultPolicyPath := config.DefaultSignaturePolicyPath if sys != nil { if sys.SignaturePolicyPath != "" { return sys.SignaturePolicyPath