// WithWarningRecorder attaches a deduplicating k8s.io/apiserver/pkg/warning#WarningRecorder to the request context. func WithWarningRecorder(handler http.Handler) http.Handler { … } var truncateAtTotalRunes … var truncateItemRunes … type recordedWarning … type recorder … func (r *recorder) AddWarning(agent, text string) { … }