Skip to content

Commit

Permalink
Merge pull request kubernetes#94910 from yashvardhan-kukreja/issue-94…
Browse files Browse the repository at this point in the history
…602/fix-comment-declaration-event

Cleaned up: the potentially misleading comment under Event struct
  • Loading branch information
k8s-ci-robot authored Oct 5, 2020
2 parents 086b65a + 07d0b4a commit 6e9475b
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 28 deletions.
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
Original file line number Diff line number Diff line change
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
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
Original file line number Diff line number Diff line change
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"`

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
Original file line number Diff line number Diff line change
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

0 comments on commit 6e9475b

Please sign in to comment.