Add extra logs for Jenkins CR create/delete events (#536)

This commit is contained in:
Piotr Ryba 2021-04-16 12:10:41 +02:00 committed by GitHub
parent 212bbe2896
commit 53802eb60b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -80,6 +80,7 @@ type jenkinsDecorator struct {
}
func (e *jenkinsDecorator) Create(evt event.CreateEvent, q workqueue.RateLimitingInterface) {
log.Log.WithValues("cr", evt.Object.GetName()).Info(fmt.Sprintf("%T/%s was created", evt.Object, evt.Object.GetName()))
e.handler.Create(evt, q)
}
@ -92,6 +93,7 @@ func (e *jenkinsDecorator) Update(evt event.UpdateEvent, q workqueue.RateLimitin
}
func (e *jenkinsDecorator) Delete(evt event.DeleteEvent, q workqueue.RateLimitingInterface) {
log.Log.WithValues("cr", evt.Object.GetName()).Info(fmt.Sprintf("%T/%s was deleted", evt.Object, evt.Object.GetName()))
e.handler.Delete(evt, q)
}