Skip to content

Commit

Permalink
Merge pull request #7160 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…7159-to-release-1.2

[release-1.2] 🐛 util/record: fix usage of case.Title in util/record
  • Loading branch information
k8s-ci-robot authored Sep 2, 2022
2 parents a82baec + dc78006 commit 723758b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions util/record/recorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@ func InitFromRecorder(recorder record.EventRecorder) {

// Event constructs an event from the given information and puts it in the queue for sending.
func Event(object runtime.Object, reason, message string) {
defaultRecorder.Event(object, corev1.EventTypeNormal, cases.Title(language.Und).String(reason), message)
defaultRecorder.Event(object, corev1.EventTypeNormal, cases.Title(language.Und, cases.NoLower).String(reason), message)
}

// Eventf is just like Event, but with Sprintf for the message field.
func Eventf(object runtime.Object, reason, message string, args ...interface{}) {
defaultRecorder.Eventf(object, corev1.EventTypeNormal, cases.Title(language.Und).String(reason), message, args...)
defaultRecorder.Eventf(object, corev1.EventTypeNormal, cases.Title(language.Und, cases.NoLower).String(reason), message, args...)
}

// Warn constructs a warning event from the given information and puts it in the queue for sending.
func Warn(object runtime.Object, reason, message string) {
defaultRecorder.Event(object, corev1.EventTypeWarning, cases.Title(language.Und).String(reason), message)
defaultRecorder.Event(object, corev1.EventTypeWarning, cases.Title(language.Und, cases.NoLower).String(reason), message)
}

// Warnf is just like Warn, but with Sprintf for the message field.
func Warnf(object runtime.Object, reason, message string, args ...interface{}) {
defaultRecorder.Eventf(object, corev1.EventTypeWarning, cases.Title(language.Und).String(reason), message, args...)
defaultRecorder.Eventf(object, corev1.EventTypeWarning, cases.Title(language.Und, cases.NoLower).String(reason), message, args...)
}

0 comments on commit 723758b

Please sign in to comment.