mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-28 02:18:15 +00:00
fix: error handling in last scan time parsing (#5808)
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
490e799b77
commit
5430d11255
1 changed files with 2 additions and 1 deletions
|
@ -230,7 +230,8 @@ func (c *controller) updateReport(ctx context.Context, meta metav1.Object, gvk s
|
|||
force = true
|
||||
} else {
|
||||
annTime, err := time.Parse(time.RFC3339, metaAnnotations[annotationLastScanTime])
|
||||
if err == nil {
|
||||
if err != nil {
|
||||
logger.Error(err, "failed to parse last scan time", "namespace", resource.Namespace, "name", resource.Name)
|
||||
force = true
|
||||
} else {
|
||||
force = time.Now().After(annTime.Add(c.forceDelay))
|
||||
|
|
Loading…
Add table
Reference in a new issue