Recognize the new lookaside names for simple signing sigstore

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2022-08-24 19:56:37 +02:00
parent f18066195d
commit cccb024d3e
4 changed files with 13 additions and 4 deletions

View File

@ -22,6 +22,8 @@ type registryConfiguration struct {
// registryNamespace defines lookaside locations for a single namespace. // registryNamespace defines lookaside locations for a single namespace.
type registryNamespace struct { type registryNamespace struct {
Lookaside string `json:"lookaside"` // For reading, and if LookasideStaging is not present, for writing.
LookasideStaging string `json:"lookaside-staging"` // For writing only.
SigStore string `json:"sigstore"` // For reading, and if SigStoreStaging is not present, for writing. SigStore string `json:"sigstore"` // For reading, and if SigStoreStaging is not present, for writing.
SigStoreStaging string `json:"sigstore-staging"` // For writing only. SigStoreStaging string `json:"sigstore-staging"` // For writing only.
} }

3
pkg/trust/testdata/quay.io.yaml vendored Normal file
View File

@ -0,0 +1,3 @@
docker:
quay.io/multi-signed:
lookaside: https://quay.example.com/sigstore

View File

@ -91,8 +91,12 @@ func getPolicyShowOutput(policyContentStruct policyContent, systemRegistriesDirP
registryNamespace := haveMatchRegistry(repo, registryConfigs) registryNamespace := haveMatchRegistry(repo, registryConfigs)
if registryNamespace != nil { if registryNamespace != nil {
if registryNamespace.Lookaside != "" {
tempTrustShowOutput.SignatureStore = registryNamespace.Lookaside
} else { // incl. registryNamespace.SigStore == ""
tempTrustShowOutput.SignatureStore = registryNamespace.SigStore tempTrustShowOutput.SignatureStore = registryNamespace.SigStore
} }
}
output = append(output, &tempTrustShowOutput) output = append(output, &tempTrustShowOutput)
} }
} }

View File

@ -66,7 +66,7 @@ func TestPolicyDescription(t *testing.T) {
Name: "quay.io/multi-signed", Name: "quay.io/multi-signed",
RepoName: "quay.io/multi-signed", RepoName: "quay.io/multi-signed",
Type: "signed", Type: "signed",
SignatureStore: "", SignatureStore: "https://quay.example.com/sigstore",
GPGId: "1, 2, 3", GPGId: "1, 2, 3",
}, },
{ {