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
d00bf0c4
Commit
d00bf0c4
authored
Oct 20, 2015
by
Timothy St. Clair
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
"Force events to be non-blocking on the client side"
parent
f5da1787
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
event.go
pkg/client/record/event.go
+4
-1
event_test.go
pkg/client/record/event_test.go
+6
-4
No files found.
pkg/client/record/event.go
View file @
d00bf0c4
...
...
@@ -261,7 +261,10 @@ func (recorder *recorderImpl) generateEvent(object runtime.Object, timestamp unv
event
:=
recorder
.
makeEvent
(
ref
,
reason
,
message
)
event
.
Source
=
recorder
.
source
recorder
.
Action
(
watch
.
Added
,
event
)
go
func
()
{
// NOTE: events should be a non-blocking operation
recorder
.
Action
(
watch
.
Added
,
event
)
}()
}
func
(
recorder
*
recorderImpl
)
Event
(
object
runtime
.
Object
,
reason
,
message
string
)
{
...
...
pkg/client/record/event_test.go
View file @
d00bf0c4
...
...
@@ -20,6 +20,7 @@ import (
"encoding/json"
"fmt"
"reflect"
"runtime"
"strconv"
"strings"
"testing"
...
...
@@ -28,7 +29,7 @@ import (
"k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/errors"
client
"k8s.io/kubernetes/pkg/client/unversioned"
"k8s.io/kubernetes/pkg/runtime"
k8sruntime
"k8s.io/kubernetes/pkg/runtime"
"k8s.io/kubernetes/pkg/util"
"k8s.io/kubernetes/pkg/util/strategicpatch"
)
...
...
@@ -127,7 +128,7 @@ func TestEventf(t *testing.T) {
t
.
Fatal
(
err
)
}
table
:=
[]
struct
{
obj
runtime
.
Object
obj
k8s
runtime
.
Object
reason
string
messageFmt
string
elements
[]
interface
{}
...
...
@@ -471,6 +472,7 @@ func TestWriteEventError(t *testing.T) {
for
caseName
:=
range
table
{
clock
.
Step
(
1
*
time
.
Second
)
recorder
.
Event
(
ref
,
"Reason"
,
caseName
)
runtime
.
Gosched
()
}
recorder
.
Event
(
ref
,
"Reason"
,
"finished"
)
<-
done
...
...
@@ -548,7 +550,7 @@ func TestEventfNoNamespace(t *testing.T) {
t
.
Fatal
(
err
)
}
table
:=
[]
struct
{
obj
runtime
.
Object
obj
k8s
runtime
.
Object
reason
string
messageFmt
string
elements
[]
interface
{}
...
...
@@ -654,7 +656,7 @@ func TestMultiSinkCache(t *testing.T) {
t
.
Fatal
(
err
)
}
table
:=
[]
struct
{
obj
runtime
.
Object
obj
k8s
runtime
.
Object
reason
string
messageFmt
string
elements
[]
interface
{}
...
...
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