Implement signature-lint cleanup and fix lint formatting

This commit is contained in:
copilot-swe-agent[bot]
2026-05-29 17:25:42 +00:00
committed by GitHub
parent c8ddde1794
commit 83adc3c890
5 changed files with 53 additions and 4 deletions
+4 -1
View File
@@ -134,6 +134,7 @@ func (linter *Linter) CheckMandatorySignatures(repo string, manifestDigest godig
}
mandatory := false
for _, mandatoryRepo := range linter.config.MandatorySignatures {
if mandatoryRepo == "*" || mandatoryRepo == "**" || repo == mandatoryRepo {
mandatory = true
@@ -228,7 +229,9 @@ func (linter *Linter) hasTrustedSignature(repo string, manifestDigest godigest.D
return false, nil
}
func getSignatureType(descriptor ispec.Descriptor, signatureManifest ispec.Manifest, manifestDigest godigest.Digest) (string, bool) {
func getSignatureType(descriptor ispec.Descriptor, signatureManifest ispec.Manifest,
manifestDigest godigest.Digest,
) (string, bool) {
artifactType := zcommon.GetManifestArtifactType(signatureManifest)
if signatureManifest.Subject != nil && signatureManifest.Subject.Digest == manifestDigest {
@@ -113,8 +113,6 @@ func TestMandatorySignaturesFunction(t *testing.T) {
})
for _, wildcard := range []string{"*", "**"} {
wildcard := wildcard
Convey("mandatory signatures check rejects unsigned images for wildcard repository list "+wildcard, t, func() {
enable := true
lintConfig := &extconf.LintConfig{