kubernetes / client-go

Go client for Kubernetes.
Apache License 2.0
8.79k stars 2.91k forks source link

Cannot check annotations in FakeRecorder #1230

Closed intUnderflow closed 1 year ago

intUnderflow commented 1 year ago

I'm writing a test where I want to check whether certain annotations are set in an event, as part of this I'm trying to use FakeRecorder, but FakeRecorder's default behaviour is to throw annotations away:

func (f *FakeRecorder) AnnotatedEventf(object runtime.Object, annotations map[string]string, eventtype, reason, messageFmt string, args ...interface{}) {
   f.Eventf(object, eventtype, reason, messageFmt, args...)

I'd like to be able to tell FakeRecorder to keep the annotations, perhaps via configuration

Will raise a PR for this :)

intUnderflow commented 1 year ago

/sig api-machinery

intUnderflow commented 1 year ago

/label needs-triage

k8s-ci-robot commented 1 year ago

@intUnderflow: The label(s) /label needs-triage cannot be applied. These labels are supported: api-review, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, team/katacoda, refactor. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

In response to [this](https://github.com/kubernetes/client-go/issues/1230#issuecomment-1437369931): >/label needs-triage Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.