mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
fix: propagate error when parsing an image fails (#6706)
* fix: propagate error when parsing an image fails Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * Apply suggestions from code review Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> --------- Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
parent
391f1ae487
commit
db29d8b2ba
2 changed files with 2 additions and 4 deletions
|
@ -453,9 +453,7 @@ OuterLoop:
|
|||
|
||||
cfg := config.NewDefaultConfiguration()
|
||||
if err := ctx.AddImageInfos(c.Resource, cfg); err != nil {
|
||||
if err != nil {
|
||||
log.Log.Error(err, "failed to add image variables to context")
|
||||
}
|
||||
log.Log.Error(err, "failed to add image variables to context")
|
||||
}
|
||||
|
||||
gvk, subresource := updatedResource.GroupVersionKind(), ""
|
||||
|
|
|
@ -109,7 +109,7 @@ func extract(obj interface{}, path []string, keyPath, valuePath string, fields [
|
|||
value = resultStr
|
||||
}
|
||||
if imageInfo, err := imageutils.GetImageInfo(value, cfg); err != nil {
|
||||
return fmt.Errorf("invalid image %s", value)
|
||||
return fmt.Errorf("invalid image %s (%s)", value, err.Error())
|
||||
} else {
|
||||
(*imageInfos)[key] = ImageInfo{*imageInfo, pointer}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue