Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
ad1212b9
Commit
ad1212b9
authored
Oct 21, 2014
by
Daniel Smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add client time to events
parent
7d5ed539
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
3 deletions
+22
-3
types.go
pkg/api/types.go
+3
-0
types.go
pkg/api/v1beta1/types.go
+3
-0
types.go
pkg/api/v1beta2/types.go
+3
-0
types.go
pkg/api/v1beta3/types.go
+3
-0
event.go
pkg/client/record/event.go
+1
-0
event_test.go
pkg/client/record/event_test.go
+9
-3
No files found.
pkg/api/types.go
View file @
ad1212b9
...
...
@@ -694,6 +694,9 @@ type Event struct {
// Optional. The component reporting this event. Should be a short machine understandable string.
// TODO: provide exact specification for format.
Source
string
`json:"source,omitempty" yaml:"source,omitempty"`
// The time at which the client recorded the event. (Time of server receipt is in TypeMeta.)
Timestamp
util
.
Time
`json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
}
// EventList is a list of events.
...
...
pkg/api/v1beta1/types.go
View file @
ad1212b9
...
...
@@ -710,6 +710,9 @@ type Event struct {
// Optional. The component reporting this event. Should be a short machine understandable string.
// TODO: provide exact specification for format.
Source
string
`json:"source,omitempty" yaml:"source,omitempty"`
// The time at which the client recorded the event. (Time of server receipt is in TypeMeta.)
Timestamp
util
.
Time
`json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
}
// EventList is a list of events.
...
...
pkg/api/v1beta2/types.go
View file @
ad1212b9
...
...
@@ -685,6 +685,9 @@ type Event struct {
// Optional. The component reporting this event. Should be a short machine understandable string.
// TODO: provide exact specification for format.
Source
string
`json:"source,omitempty" yaml:"source,omitempty"`
// The time at which the client recorded the event. (Time of server receipt is in TypeMeta.)
Timestamp
util
.
Time
`json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
}
// EventList is a list of events.
...
...
pkg/api/v1beta3/types.go
View file @
ad1212b9
...
...
@@ -912,6 +912,9 @@ type Event struct {
// Optional. The component reporting this event. Should be a short machine understandable string.
// TODO: provide exact specification for format.
Source
string
`json:"source,omitempty" yaml:"source,omitempty"`
// The time at which the client recorded the event. (Time of server receipt is in TypeMeta.)
Timestamp
util
.
Time
`json:"timestamp,omitempty" yaml:"timestamp,omitempty"`
}
// EventList is a list of events.
...
...
pkg/client/record/event.go
View file @
ad1212b9
...
...
@@ -108,6 +108,7 @@ func Event(object runtime.Object, fieldPath, status, reason, message string) {
Status
:
status
,
Reason
:
reason
,
Message
:
message
,
Timestamp
:
util
.
Now
(),
}
events
.
Action
(
watch
.
Added
,
e
)
...
...
pkg/client/record/event_test.go
View file @
ad1212b9
...
...
@@ -84,12 +84,18 @@ func TestEventf(t *testing.T) {
for
_
,
item
:=
range
table
{
called
:=
make
(
chan
struct
{})
testEvents
:=
testEventRecorder
{
OnEvent
:
func
(
a
*
api
.
Event
)
(
*
api
.
Event
,
error
)
{
if
e
:=
item
.
expect
;
!
reflect
.
DeepEqual
(
e
,
a
)
{
OnEvent
:
func
(
event
*
api
.
Event
)
(
*
api
.
Event
,
error
)
{
a
:=
*
event
// Just check that the timestamp was set.
if
a
.
Timestamp
.
IsZero
()
{
t
.
Errorf
(
"timestamp wasn't set"
)
}
a
.
Timestamp
=
item
.
expect
.
Timestamp
if
e
,
a
:=
item
.
expect
,
&
a
;
!
reflect
.
DeepEqual
(
e
,
a
)
{
t
.
Errorf
(
"diff: %s"
,
util
.
ObjectDiff
(
e
,
a
))
}
called
<-
struct
{}{}
return
a
,
nil
return
event
,
nil
},
}
recorder
:=
record
.
StartRecording
(
&
testEvents
,
"eventTest"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment