Skip to content

Commit 1e6e0a9

Browse files
committed
Process event updates
When identical events are emitted for a resource, kube-apiserver updates the previous event and increments the count field to represent how many times an event occurred. This is to optimize storage on ETCD. Such consolidation results in an `update` on the event. Currently, the events exporter doesn't process any events that get updated so when similar events re-occur, they aren't processed. This change enables processing events that get updated.
1 parent 2668c43 commit 1e6e0a9

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ require (
4141
github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect
4242
github.com/eapache/queue v1.1.0 // indirect
4343
github.com/emicklei/go-restful/v3 v3.10.1 // indirect
44-
github.com/evanphx/json-patch v4.12.0+incompatible // indirect
4544
github.com/fatih/color v1.15.0 // indirect
4645
github.com/go-kit/log v0.2.1 // indirect
4746
github.com/go-logfmt/logfmt v0.5.1 // indirect

go.sum

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.m
6767
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
6868
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
6969
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
70-
github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
7170
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
7271
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
7372
github.com/flowstack/go-jsonschema v0.1.1/go.mod h1:yL7fNggx1o8rm9RlgXv7hTBWxdBM0rVwpMwimd3F3N0=

pkg/kube/watcher.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ func (e *EventWatcher) OnAdd(obj interface{}) {
6363
}
6464

6565
func (e *EventWatcher) OnUpdate(oldObj, newObj interface{}) {
66-
// Ignore updates
66+
event := newObj.(*corev1.Event)
67+
e.onEvent(event)
6768
}
6869

6970
// Ignore events older than the maxEventAgeSeconds

0 commit comments

Comments
 (0)