1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-01-20 18:52:16 +00:00
kyverno/pkg/globalcontext/event/event.go
Khaled Emara c2a9e9ef69
feat(events): normalize gctx events reason to be inline with other po… (#10395)
* feat(events): normalize gctx events reason to be inline with other policies

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* chore(events): hide queue limit messages at a higher level

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

* test(gctx): add factory test

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>

---------

Signed-off-by: Khaled Emara <khaled.emara@nirmata.com>
Co-authored-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2024-07-04 16:12:48 +03:00

22 lines
429 B
Go

package event
import (
"github.com/kyverno/kyverno/pkg/event"
corev1 "k8s.io/api/core/v1"
)
const (
source = "globalcontext-controller"
action = "Retrying"
)
func NewErrorEvent(regarding corev1.ObjectReference, err error) event.Info {
return event.Info{
Regarding: regarding,
Source: source,
Reason: event.PolicyError,
Message: err.Error(),
Action: action,
Type: corev1.EventTypeWarning,
}
}