image level lint: enforce manifest mandatory annotations

closes #536

Signed-off-by: Lisca Ana-Roberta <ana.kagome@yahoo.com>
This commit is contained in:
Lisca Ana-Roberta
2022-06-24 16:08:47 +03:00
committed by Andrei Aaron
parent 3d72dad507
commit 87fc941b3c
34 changed files with 1391 additions and 110 deletions
+18
View File
@@ -0,0 +1,18 @@
package mocks
import (
godigest "github.com/opencontainers/go-digest"
"zotregistry.io/zot/pkg/storage"
)
type MockedLint struct {
LintFn func(repo string, manifestDigest godigest.Digest, imageStore storage.ImageStore) (bool, error)
}
func (lint MockedLint) Lint(repo string, manifestDigest godigest.Digest, imageStore storage.ImageStore) (bool, error) {
if lint.LintFn != nil {
return lint.LintFn(repo, manifestDigest, imageStore)
}
return false, nil
}