2022-06-24 08:08:47 -05:00
|
|
|
package mocks
|
|
|
|
|
|
|
|
import (
|
|
|
|
godigest "github.com/opencontainers/go-digest"
|
2022-10-20 11:39:20 -05:00
|
|
|
|
2024-01-31 23:34:07 -05:00
|
|
|
storageTypes "zotregistry.dev/zot/pkg/storage/types"
|
2022-06-24 08:08:47 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
type MockedLint struct {
|
2023-05-26 13:08:19 -05:00
|
|
|
LintFn func(repo string, manifestDigest godigest.Digest, imageStore storageTypes.ImageStore) (bool, error)
|
2022-06-24 08:08:47 -05:00
|
|
|
}
|
|
|
|
|
2023-05-26 13:08:19 -05:00
|
|
|
func (lint MockedLint) Lint(repo string, manifestDigest godigest.Digest, imageStore storageTypes.ImageStore,
|
|
|
|
) (bool, error) {
|
2022-06-24 08:08:47 -05:00
|
|
|
if lint.LintFn != nil {
|
|
|
|
return lint.LintFn(repo, manifestDigest, imageStore)
|
|
|
|
}
|
|
|
|
|
|
|
|
return false, nil
|
|
|
|
}
|