func (r *APIRecorder) WithAnnotations(keysAndValues ...string) Recorder {
	ar := NewAPIRecorder(r.kube)
	for k, v := range r.annotations {
		ar.annotations[k] = v
	}
	sliceMap(keysAndValues, ar.annotations)
	return ar
}
WithAnnotations returns a new *APIRecorder that includes the supplied
annotations with all recorded events.
package event
import (
	"k8s.io/apimachinery/pkg/runtime"
	"k8s.io/client-go/tools/record"
)
type Type string
var (
	TypeNormal  Type = "Normal"
	TypeWarning Type = "Warning"
)
type Reason string
type Event struct {
	Type        Type
	Reason      Reason
	Message     string
	Annotations map[string]string
}
func Normal(r Reason, message string, keysAndValues ...string) Event {
	e := Event{
		Type:        TypeNormal,
		Reason:      r,
		Message:     message,
		Annotations: map[string]string{},
	}
	sliceMap(keysAndValues, e.Annotations)
	return e
}
func Warning(r Reason, err error, keysAndValues ...string) Event {
	e := Event{
		Type:        TypeWarning,
		Reason:      r,
		Message:     err.Error(),
		Annotations: map[string]string{},
	}
	sliceMap(keysAndValues, e.Annotations)
	return e
}
type Recorder interface {
	Event(obj runtime.Object, e Event)
	WithAnnotations(keysAndValues ...string) Recorder
}
type APIRecorder struct {
	kube        record.EventRecorder
	annotations map[string]string
}
func NewAPIRecorder(r record.EventRecorder) *APIRecorder {
	return &APIRecorder{kube: r, annotations: map[string]string{}}
}
func (r *APIRecorder) Event(obj runtime.Object, e Event) {
	r.kube.AnnotatedEventf(obj, r.annotations, string(e.Type), string(e.Reason), e.Message)
}