summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/trust/trust.go25
1 files changed, 16 insertions, 9 deletions
diff --git a/pkg/trust/trust.go b/pkg/trust/trust.go
index 7412fab20..7b1b798ca 100644
--- a/pkg/trust/trust.go
+++ b/pkg/trust/trust.go
@@ -84,6 +84,18 @@ func getPolicyShowOutput(policyContentStruct policyContent, systemRegistriesDirP
// descriptionsOfPolicyRequirements turns reqs into user-readable policy entries, with Transport/Name/Reponame coming from template, potentially looking up scope (which may be "") in registryConfigs.
func descriptionsOfPolicyRequirements(reqs []repoContent, template Policy, registryConfigs *registryConfiguration, scope string, idReader gpgIDReader) []*Policy {
+ res := []*Policy{}
+
+ var lookasidePath string
+ registryNamespace := registriesDConfigurationForScope(registryConfigs, scope)
+ if registryNamespace != nil {
+ if registryNamespace.Lookaside != "" {
+ lookasidePath = registryNamespace.Lookaside
+ } else { // incl. registryNamespace.SigStore == ""
+ lookasidePath = registryNamespace.SigStore
+ }
+ }
+
entry := template
entry.Type = trustTypeDescription(reqs[0].Type)
uids := []string{}
@@ -96,14 +108,9 @@ func descriptionsOfPolicyRequirements(reqs []repoContent, template Policy, regis
}
}
entry.GPGId = strings.Join(uids, ", ")
+ entry.SignatureStore = lookasidePath
- registryNamespace := registriesDConfigurationForScope(registryConfigs, scope)
- if registryNamespace != nil {
- if registryNamespace.Lookaside != "" {
- entry.SignatureStore = registryNamespace.Lookaside
- } else { // incl. registryNamespace.SigStore == ""
- entry.SignatureStore = registryNamespace.SigStore
- }
- }
- return []*Policy{&entry}
+ res = append(res, &entry)
+
+ return res
}