mirror of
https://github.com/containers/podman.git
synced 2025-09-26 00:06:04 +08:00
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 <dfr@rabson.org>
This commit is contained in:
@ -12,6 +12,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/containers/common/pkg/config"
|
||||||
"github.com/containers/image/v5/types"
|
"github.com/containers/image/v5/types"
|
||||||
"github.com/sirupsen/logrus"
|
"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.
|
// DefaultPolicyPath returns a path to the default policy of the system.
|
||||||
func DefaultPolicyPath(sys *types.SystemContext) string {
|
func DefaultPolicyPath(sys *types.SystemContext) string {
|
||||||
systemDefaultPolicyPath := "/etc/containers/policy.json"
|
systemDefaultPolicyPath := config.DefaultSignaturePolicyPath
|
||||||
if sys != nil {
|
if sys != nil {
|
||||||
if sys.SignaturePolicyPath != "" {
|
if sys.SignaturePolicyPath != "" {
|
||||||
return sys.SignaturePolicyPath
|
return sys.SignaturePolicyPath
|
||||||
|
Reference in New Issue
Block a user