1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2024-12-15 17:51:20 +00:00
kyverno/pkg/event/info.go
Mariam Fahmy a60dc00392
feat: migrate to events.k8s.io/v1 (#7673)
* feat: migrate events to events.k8s.io group

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* fix: kuttl event tests

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* migrate background events to events.k8s.io

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* update kuttl tests

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

* remove ResourceSkipped from actions

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>

---------

Signed-off-by: Mariam Fahmy <mariam.fahmy@nirmata.com>
2023-07-26 14:06:51 +00:00

25 lines
557 B
Go

package event
import "strings"
// Info defines the event details
type Info struct {
Kind string
Name string
Namespace string
RelatedAPIVersion string
RelatedKind string
RelatedName string
RelatedNamespace string
Reason Reason
Message string
Action Action
Source Source
}
func (i *Info) Resource() string {
if i.Namespace == "" {
return strings.Join([]string{i.Kind, i.Name}, "/")
}
return strings.Join([]string{i.Kind, i.Namespace, i.Name}, "/")
}