summaryrefslogtreecommitdiff
path: root/pkg/trust/trust.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/trust/trust.go')
-rw-r--r--pkg/trust/trust.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/pkg/trust/trust.go b/pkg/trust/trust.go
index a9ce99dd3..7412fab20 100644
--- a/pkg/trust/trust.go
+++ b/pkg/trust/trust.go
@@ -44,13 +44,12 @@ func getPolicyShowOutput(policyContentStruct policyContent, systemRegistriesDirP
}
if len(policyContentStruct.Default) > 0 {
- defaultPolicyStruct := Policy{
+ template := Policy{
Transport: "all",
Name: "* (default)",
RepoName: "default",
- Type: trustTypeDescription(policyContentStruct.Default[0].Type),
}
- output = append(output, &defaultPolicyStruct)
+ output = append(output, descriptionsOfPolicyRequirements(policyContentStruct.Default, template, registryConfigs, "", idReader)...)
}
// FIXME: This should use x/exp/maps.Keys after we update to Go 1.18.
transports := []string{}
@@ -83,7 +82,7 @@ func getPolicyShowOutput(policyContentStruct policyContent, systemRegistriesDirP
return output, nil
}
-// descriptionsOfPolicyRequirements turns reqs into user-readable policy entries, with Transport/Name/Reponame coming from template, potentially looking up scope in registryConfigs.
+// 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 {
entry := template
entry.Type = trustTypeDescription(reqs[0].Type)