Skip to content

EventRecorder comment contradicts with Event field comment #1375

Closed as not planned
@npinaeva

Description

@npinaeva

EventRecorder interface used for events/v1 says

// 'reason' is the reason this event is generated. 'reason' should be short and unique; it
// should be in UpperCamelCase format (starting with a capital letter). "reason" will be used
// to automate handling of events, so imagine people writing switch statements to handle them.
// You want to make that easy.

implying that the field should be machine-readable. At the same time Event.Reason comment says

	// reason is why the action was taken. It is human-readable.
	// This field cannot be empty for new Events and it can have at most 128 characters.

https://github.com/kubernetes/api/blob/9dc1a952bda9aeb400aa6409b7d89eff50d6ea77/events/v1/types.go#L61-L63
implying it should be human-readable. Also, Event.Action field says it should be machine-readable, so I would expect it to be used for switch statements.
I am confused, please help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions