feat: propagate detailed error msgs to client (OCI dist-spec format) (#1681)

Signed-off-by: Alexei Dodon <adodon@cisco.com>
This commit is contained in:
Alexei Dodon
2023-08-23 20:59:52 +03:00
committed by GitHub
parent 94429a82df
commit 247f6dcd3f
10 changed files with 292 additions and 200 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ import (
)
func GetLinter(config *config.Config, log log.Logger) *lint.Linter {
log.Warn().Msg("lint extension is disabled because given zot binary doesn't" +
log.Warn().Msg("lint extension is disabled because given zot binary doesn't " +
"include this feature please build a binary that does so")
return nil
+1 -1
View File
@@ -105,7 +105,7 @@ func (linter *Linter) CheckMandatoryAnnotations(repo string, manifestDigest godi
string(manifestDigest), string(configDigest), missingAnnotations)
linter.log.Error().Msg(msg)
return false, fmt.Errorf("%s: %w", msg, zerr.ErrImageLintAnnotations)
return false, zerr.NewError(zerr.ErrImageLintAnnotations).AddDetail("missingAnnotations", msg)
}
return true, nil