1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

fix: Added missing label info in the cleanup metrics (#10321) (#11147) (#11159)

Signed-off-by: Pradeep Lakshmi Narasimha <pradeep.vaishnav4@gmail.com>
Co-authored-by: Pradeep Lakshmi Narasimha <pradeep.vaishnav4@gmail.com>
This commit is contained in:
gcp-cherry-pick-bot[bot] 2024-09-16 09:26:48 +00:00 committed by GitHub
parent 019b0335ac
commit eeedaaea72
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,6 +57,7 @@ func newController(client metadata.Getter, metainformer informers.GenericInforme
informer: metainformer.Informer(),
logger: logger,
metrics: newTTLMetrics(logger),
gvr: gvr,
}
enqueue := controllerutils.LogError(logger, controllerutils.Parse(controllerutils.MetaNamespaceKey, controllerutils.Queue(queue)))
registration, err := controllerutils.AddEventHandlers(
@ -144,7 +145,7 @@ func (c *controller) reconcile(ctx context.Context, logger logr.Logger, itemKey
attribute.String("resource_namespace", metaObj.GetNamespace()),
attribute.String("resource_group", c.gvr.Group),
attribute.String("resource_version", c.gvr.Version),
attribute.String("resource", c.gvr.Resource),
attribute.String("resource_resource", c.gvr.Resource),
}
// if the object is being deleted, return early
if metaObj.GetDeletionTimestamp() != nil {