mirror of
https://github.com/kubernetes/sample-controller.git
synced 2026-05-01 00:00:03 +08:00
Merge pull request #49112 from gmarek/eventAPI
Automatic merge from submit-queue (batch tested with PRs 55952, 49112, 55450, 56178, 56151). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. New API group for Events. Fix kubernetes/features#383 cc @shyamjvs ```release-note Add events.k8s.io api group with v1beta1 API containing redesigned Event type. ``` Kubernetes-commit: 60c20901911c710491a57eb8b9c48850cdbab054
This commit is contained in:
+1806
-1360
File diff suppressed because it is too large
Load Diff
+37
-1
@@ -1029,7 +1029,6 @@ message EnvVarSource {
|
||||
}
|
||||
|
||||
// Event is a report of an event somewhere in the cluster.
|
||||
// TODO: Decide whether to store these separately or with the object they apply to.
|
||||
message Event {
|
||||
// Standard object's metadata.
|
||||
// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata
|
||||
@@ -1068,6 +1067,30 @@ message Event {
|
||||
// Type of this event (Normal, Warning), new types could be added in the future
|
||||
// +optional
|
||||
optional string type = 9;
|
||||
|
||||
// Time when this Event was first observed.
|
||||
// +optional
|
||||
optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime eventTime = 10;
|
||||
|
||||
// Data about the Event series this event represents or nil if it's a singleton Event.
|
||||
// +optional
|
||||
optional EventSeries series = 11;
|
||||
|
||||
// What action was taken/failed regarding to the Regarding object.
|
||||
// +optional
|
||||
optional string action = 12;
|
||||
|
||||
// Optional secondary object for more complex actions.
|
||||
// +optional
|
||||
optional ObjectReference related = 13;
|
||||
|
||||
// Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`.
|
||||
// +optional
|
||||
optional string reportingComponent = 14;
|
||||
|
||||
// ID of the controller instance, e.g. `kubelet-xyzf`.
|
||||
// +optional
|
||||
optional string reportingInstance = 15;
|
||||
}
|
||||
|
||||
// EventList is a list of events.
|
||||
@@ -1081,6 +1104,19 @@ message EventList {
|
||||
repeated Event items = 2;
|
||||
}
|
||||
|
||||
// EventSeries contain information on series of events, i.e. thing that was/is happening
|
||||
// continously for some time.
|
||||
message EventSeries {
|
||||
// Number of occurrences in this series up to the last heartbeat time
|
||||
optional int32 count = 1;
|
||||
|
||||
// Time of the last occurence observed
|
||||
optional k8s.io.apimachinery.pkg.apis.meta.v1.MicroTime lastObservedTime = 2;
|
||||
|
||||
// State of this Series: Ongoing or Finished
|
||||
optional string state = 3;
|
||||
}
|
||||
|
||||
// EventSource contains information for an event.
|
||||
message EventSource {
|
||||
// Component from which the event is generated.
|
||||
|
||||
+43
-1
@@ -4468,7 +4468,6 @@ const (
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// Event is a report of an event somewhere in the cluster.
|
||||
// TODO: Decide whether to store these separately or with the object they apply to.
|
||||
type Event struct {
|
||||
metav1.TypeMeta `json:",inline"`
|
||||
// Standard object's metadata.
|
||||
@@ -4508,8 +4507,51 @@ type Event struct {
|
||||
// Type of this event (Normal, Warning), new types could be added in the future
|
||||
// +optional
|
||||
Type string `json:"type,omitempty" protobuf:"bytes,9,opt,name=type"`
|
||||
|
||||
// Time when this Event was first observed.
|
||||
// +optional
|
||||
EventTime metav1.MicroTime `json:"eventTime,omitempty" protobuf:"bytes,10,opt,name=eventTime"`
|
||||
|
||||
// Data about the Event series this event represents or nil if it's a singleton Event.
|
||||
// +optional
|
||||
Series *EventSeries `json:"series,omitempty" protobuf:"bytes,11,opt,name=series"`
|
||||
|
||||
// What action was taken/failed regarding to the Regarding object.
|
||||
// +optional
|
||||
Action string `json:"action,omitempty" protobuf:"bytes,12,opt,name=action"`
|
||||
|
||||
// Optional secondary object for more complex actions.
|
||||
// +optional
|
||||
Related *ObjectReference `json:"related,omitempty" protobuf:"bytes,13,opt,name=related"`
|
||||
|
||||
// Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`.
|
||||
// +optional
|
||||
ReportingController string `json:"reportingComponent" protobuf:"bytes,14,opt,name=reportingComponent"`
|
||||
|
||||
// ID of the controller instance, e.g. `kubelet-xyzf`.
|
||||
// +optional
|
||||
ReportingInstance string `json:"reportingInstance" protobuf:"bytes,15,opt,name=reportingInstance"`
|
||||
}
|
||||
|
||||
// EventSeries contain information on series of events, i.e. thing that was/is happening
|
||||
// continously for some time.
|
||||
type EventSeries struct {
|
||||
// Number of occurrences in this series up to the last heartbeat time
|
||||
Count int32 `json:"count,omitempty" protobuf:"varint,1,name=count"`
|
||||
// Time of the last occurence observed
|
||||
LastObservedTime metav1.MicroTime `json:"lastObservedTime,omitempty" protobuf:"bytes,2,name=lastObservedTime"`
|
||||
// State of this Series: Ongoing or Finished
|
||||
State EventSeriesState `json:"state,omitempty" protobuf:"bytes,3,name=state"`
|
||||
}
|
||||
|
||||
type EventSeriesState string
|
||||
|
||||
const (
|
||||
EventSeriesStateOngoing EventSeriesState = "Ongoing"
|
||||
EventSeriesStateFinished EventSeriesState = "Finished"
|
||||
EventSeriesStateUnknown EventSeriesState = "Unknown"
|
||||
)
|
||||
|
||||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
|
||||
|
||||
// EventList is a list of events.
|
||||
|
||||
+27
-10
@@ -541,16 +541,22 @@ func (EnvVarSource) SwaggerDoc() map[string]string {
|
||||
}
|
||||
|
||||
var map_Event = map[string]string{
|
||||
"": "Event is a report of an event somewhere in the cluster.",
|
||||
"metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata",
|
||||
"involvedObject": "The object that this event is about.",
|
||||
"reason": "This should be a short, machine understandable string that gives the reason for the transition into the object's current status.",
|
||||
"message": "A human-readable description of the status of this operation.",
|
||||
"source": "The component reporting this event. Should be a short machine understandable string.",
|
||||
"firstTimestamp": "The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)",
|
||||
"lastTimestamp": "The time at which the most recent occurrence of this event was recorded.",
|
||||
"count": "The number of times this event has occurred.",
|
||||
"type": "Type of this event (Normal, Warning), new types could be added in the future",
|
||||
"": "Event is a report of an event somewhere in the cluster.",
|
||||
"metadata": "Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata",
|
||||
"involvedObject": "The object that this event is about.",
|
||||
"reason": "This should be a short, machine understandable string that gives the reason for the transition into the object's current status.",
|
||||
"message": "A human-readable description of the status of this operation.",
|
||||
"source": "The component reporting this event. Should be a short machine understandable string.",
|
||||
"firstTimestamp": "The time at which the event was first recorded. (Time of server receipt is in TypeMeta.)",
|
||||
"lastTimestamp": "The time at which the most recent occurrence of this event was recorded.",
|
||||
"count": "The number of times this event has occurred.",
|
||||
"type": "Type of this event (Normal, Warning), new types could be added in the future",
|
||||
"eventTime": "Time when this Event was first observed.",
|
||||
"series": "Data about the Event series this event represents or nil if it's a singleton Event.",
|
||||
"action": "What action was taken/failed regarding to the Regarding object.",
|
||||
"related": "Optional secondary object for more complex actions.",
|
||||
"reportingComponent": "Name of the controller that emitted this Event, e.g. `kubernetes.io/kubelet`.",
|
||||
"reportingInstance": "ID of the controller instance, e.g. `kubelet-xyzf`.",
|
||||
}
|
||||
|
||||
func (Event) SwaggerDoc() map[string]string {
|
||||
@@ -567,6 +573,17 @@ func (EventList) SwaggerDoc() map[string]string {
|
||||
return map_EventList
|
||||
}
|
||||
|
||||
var map_EventSeries = map[string]string{
|
||||
"": "EventSeries contain information on series of events, i.e. thing that was/is happening continously for some time.",
|
||||
"count": "Number of occurrences in this series up to the last heartbeat time",
|
||||
"lastObservedTime": "Time of the last occurence observed",
|
||||
"state": "State of this Series: Ongoing or Finished",
|
||||
}
|
||||
|
||||
func (EventSeries) SwaggerDoc() map[string]string {
|
||||
return map_EventSeries
|
||||
}
|
||||
|
||||
var map_EventSource = map[string]string{
|
||||
"": "EventSource contains information for an event.",
|
||||
"component": "Component from which the event is generated.",
|
||||
|
||||
+36
@@ -1383,6 +1383,25 @@ func (in *Event) DeepCopyInto(out *Event) {
|
||||
out.Source = in.Source
|
||||
in.FirstTimestamp.DeepCopyInto(&out.FirstTimestamp)
|
||||
in.LastTimestamp.DeepCopyInto(&out.LastTimestamp)
|
||||
in.EventTime.DeepCopyInto(&out.EventTime)
|
||||
if in.Series != nil {
|
||||
in, out := &in.Series, &out.Series
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(EventSeries)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
if in.Related != nil {
|
||||
in, out := &in.Related, &out.Related
|
||||
if *in == nil {
|
||||
*out = nil
|
||||
} else {
|
||||
*out = new(ObjectReference)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1439,6 +1458,23 @@ func (in *EventList) DeepCopyObject() runtime.Object {
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *EventSeries) DeepCopyInto(out *EventSeries) {
|
||||
*out = *in
|
||||
in.LastObservedTime.DeepCopyInto(&out.LastObservedTime)
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventSeries.
|
||||
func (in *EventSeries) DeepCopy() *EventSeries {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(EventSeries)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *EventSource) DeepCopyInto(out *EventSource) {
|
||||
*out = *in
|
||||
|
||||
Reference in New Issue
Block a user