From 6be78c639a1e85761c07fcd8605bcf36d6bb43fe Mon Sep 17 00:00:00 2001 From: TwiN Date: Mon, 14 Nov 2022 22:50:23 -0500 Subject: [PATCH] chore: Update TwiN/kevent to v0.1.1 --- README.md | 7 +++++++ go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/TwiN/kevent/kevent.go | 6 +++++- vendor/modules.txt | 2 +- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 91f0efc..4c884f5 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,13 @@ rules: - "get" - "list" - "delete" + - apiGroups: + - "" + - "events.k8s.io" + resources: + - "events" + verbs: + - "create" --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding diff --git a/go.mod b/go.mod index 0910388..6ccb8ab 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/TwiN/k8s-ttl-controller go 1.19 require ( - github.com/TwiN/kevent v0.1.0 + github.com/TwiN/kevent v0.1.1 github.com/xhit/go-str2duration/v2 v2.0.0 k8s.io/api v0.25.4 k8s.io/apimachinery v0.25.4 diff --git a/go.sum b/go.sum index bf107e4..e4ea50a 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/TwiN/kevent v0.1.0 h1:r9JNR+rCiSgMuO1gbRlbTfqS3tdcOl8+zdhcEL1rSRE= -github.com/TwiN/kevent v0.1.0/go.mod h1:vtWKyP6/+1rJOcfjnV9ZKTh6/v0LAi0bKzWeG/gDxC4= +github.com/TwiN/kevent v0.1.1 h1:6WyCoaFgxcrWFcVRybCzpDon9+k8zlKPvwembVUsrds= +github.com/TwiN/kevent v0.1.1/go.mod h1:vtWKyP6/+1rJOcfjnV9ZKTh6/v0LAi0bKzWeG/gDxC4= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= diff --git a/vendor/github.com/TwiN/kevent/kevent.go b/vendor/github.com/TwiN/kevent/kevent.go index 433b8e2..c4c7fd8 100644 --- a/vendor/github.com/TwiN/kevent/kevent.go +++ b/vendor/github.com/TwiN/kevent/kevent.go @@ -27,7 +27,6 @@ func NewEventManager(kubernetesClient kubernetes.Interface, component string) *E scheme: runtime.NewScheme(), } em.broadcaster = record.NewBroadcaster() - em.broadcaster.StartStructuredLogging(4) em.broadcaster.StartRecordingToSink(&typedv1core.EventSinkImpl{Interface: kubernetesClient.CoreV1().Events("")}) em.recorder = em.broadcaster.NewRecorder(em.scheme, corev1.EventSource{Component: component}) return em @@ -52,3 +51,8 @@ func (em *EventManager) Create(resourceNamespace, resourceKind, resourceName, re } em.recorder.Event(us, eventType, reason, message) } + +// EnableDebugLogs enables debug logs for the EventManager. +func (em *EventManager) EnableDebugLogs() { + em.broadcaster.StartStructuredLogging(4) +} diff --git a/vendor/modules.txt b/vendor/modules.txt index b4224f8..1b34d71 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,4 +1,4 @@ -# github.com/TwiN/kevent v0.1.0 +# github.com/TwiN/kevent v0.1.1 ## explicit; go 1.19 github.com/TwiN/kevent # github.com/davecgh/go-spew v1.1.1