Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaned up: the potentially misleading comment under Event struct #94910

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions api/openapi-spec/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/apis/core/types.go
Expand Up @@ -4568,10 +4568,10 @@ const (
// TODO: Decide whether to store these separately or with the object they apply to.
type Event struct {
metav1.TypeMeta
// +optional

metav1.ObjectMeta

// Required. The object that this event is about. Mapped to events.Event.regarding
// The object that this event is about. Mapped to events.Event.regarding
// +optional
yashvardhan-kukreja marked this conversation as resolved.
Show resolved Hide resolved
liggitt marked this conversation as resolved.
Show resolved Hide resolved
InvolvedObject ObjectReference

Expand Down
11 changes: 3 additions & 8 deletions staging/src/k8s.io/api/events/v1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions staging/src/k8s.io/api/events/v1/types.go
Expand Up @@ -27,8 +27,8 @@ import (
// Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system.
type Event struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

wojtek-t marked this conversation as resolved.
Show resolved Hide resolved
metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"`

// eventTime is the time when this Event was first observed. It is required.
EventTime metav1.MicroTime `json:"eventTime" protobuf:"bytes,2,opt,name=eventTime"`
Expand All @@ -39,22 +39,18 @@ type Event struct {

// reportingController is the name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`.
// This field cannot be empty for new Events.
// +optional
ReportingController string `json:"reportingController,omitempty" protobuf:"bytes,4,opt,name=reportingController"`

// reportingInstance is the ID of the controller instance, e.g. `kubelet-xyzf`.
// This field cannot be empty for new Events and it can have at most 128 characters.
// +optional
ReportingInstance string `json:"reportingInstance,omitempty" protobuf:"bytes,5,opt,name=reportingInstance"`

// action is what action was taken/failed regarding to the regarding object. It is machine-readable.
// This field can have at most 128 characters.
// +optional
// This field cannot be empty for new Events and it can have at most 128 characters.
Action string `json:"action,omitempty" protobuf:"bytes,6,name=action"`

// reason is why the action was taken. It is human-readable.
// This field can have at most 128 characters.
// +optional
// This field cannot be empty for new Events and it can have at most 128 characters.
Reason string `json:"reason,omitempty" protobuf:"bytes,7,name=reason"`

// regarding contains the object this Event is about. In most cases it's an Object reporting controller
Expand All @@ -76,7 +72,7 @@ type Event struct {

// type is the type of this event (Normal, Warning), new types could be added in the future.
// It is machine-readable.
// +optional
// This field cannot be empty for new Events.
Type string `json:"type,omitempty" protobuf:"bytes,11,opt,name=type"`

// deprecatedSource is the deprecated field assuring backward compatibility with core.v1 Event type.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion staging/src/k8s.io/api/events/v1beta1/generated.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions staging/src/k8s.io/api/events/v1beta1/types.go
Expand Up @@ -29,8 +29,8 @@ import (
// Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system.
type Event struct {
metav1.TypeMeta `json:",inline"`
// +optional
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

metav1.ObjectMeta `json:"metadata" protobuf:"bytes,1,opt,name=metadata"`

// eventTime is the time when this Event was first observed. It is required.
EventTime metav1.MicroTime `json:"eventTime" protobuf:"bytes,2,opt,name=eventTime"`
Expand Down