mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-26 15:17:05 +00:00
add event_expansion for v1beta1 Events
Signed-off-by: Yassine TIJANI <ytijani@vmware.com> Kubernetes-commit: e29cb0fb7fbf5470e7caf2b3f1fc3d039bdda4ca
This commit is contained in:
committed by
Kubernetes Publisher
parent
d2583122ce
commit
f6c046f83a
@@ -34,6 +34,7 @@ import (
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
"k8s.io/apimachinery/pkg/util/strategicpatch"
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
typedv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1"
|
||||
"k8s.io/client-go/tools/record/util"
|
||||
"k8s.io/klog"
|
||||
)
|
||||
@@ -65,6 +66,28 @@ type eventBroadcasterImpl struct {
|
||||
sink EventSink
|
||||
}
|
||||
|
||||
// EventSinkImpl wraps EventInterface to implement EventSink.
|
||||
// TODO: this makes it easier for testing purpose and masks the logic of performing API calls.
|
||||
// Note that rollbacking to raw clientset should also be transparent.
|
||||
type EventSinkImpl struct {
|
||||
Interface typedv1beta1.EventInterface
|
||||
}
|
||||
|
||||
// Create is the same as CreateWithEventNamespace of the EventExpansion
|
||||
func (e *EventSinkImpl) Create(event *v1beta1.Event) (*v1beta1.Event, error) {
|
||||
return e.Interface.CreateWithEventNamespace(event)
|
||||
}
|
||||
|
||||
// Update is the same as UpdateithEventNamespace of the EventExpansion
|
||||
func (e *EventSinkImpl) Update(event *v1beta1.Event) (*v1beta1.Event, error) {
|
||||
return e.Interface.UpdateWithEventNamespace(event)
|
||||
}
|
||||
|
||||
// Patch is the same as PatchWithEventNamespace of the EventExpansion
|
||||
func (e *EventSinkImpl) Patch(event *v1beta1.Event, data []byte) (*v1beta1.Event, error) {
|
||||
return e.Interface.PatchWithEventNamespace(event, data)
|
||||
}
|
||||
|
||||
// NewBroadcaster Creates a new event broadcaster.
|
||||
func NewBroadcaster(sink EventSink) EventBroadcaster {
|
||||
return newBroadcaster(sink, defaultSleepDuration)
|
||||
|
Reference in New Issue
Block a user