Skip to content

Commit

Permalink
pkg/trust: Take the default policy path from c/common/pkg/config
Browse files Browse the repository at this point in the history
This reduces the number of places default policy path is defined to two.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <[email protected]>
  • Loading branch information
dfr committed Nov 25, 2022
1 parent fd142ef commit 6502b1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/trust/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"path/filepath"
"strings"

"github.com/containers/common/pkg/config"
"github.com/containers/image/v5/types"
"github.com/sirupsen/logrus"
)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6502b1f

Please sign in to comment.