mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
b54e6230c5
* refactor: make events controller shutdown graceful Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * nit Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * drain Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * refactor: events controller Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * exception Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * remove queue Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> --------- Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Co-authored-by: shuting <shuting@nirmata.com>
24 lines
507 B
Go
24 lines
507 B
Go
package event
|
|
|
|
import (
|
|
"strings"
|
|
|
|
corev1 "k8s.io/api/core/v1"
|
|
)
|
|
|
|
// Info defines the event details
|
|
type Info struct {
|
|
Regarding corev1.ObjectReference
|
|
Related *corev1.ObjectReference
|
|
Reason Reason
|
|
Message string
|
|
Action Action
|
|
Source Source
|
|
}
|
|
|
|
func (i *Info) Resource() string {
|
|
if i.Regarding.Namespace == "" {
|
|
return strings.Join([]string{i.Regarding.Kind, i.Regarding.Name}, "/")
|
|
}
|
|
return strings.Join([]string{i.Regarding.Kind, i.Regarding.Namespace, i.Regarding.Name}, "/")
|
|
}
|