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
c5924d20
Commit
c5924d20
authored
Dec 03, 2015
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #17817 from mqliang/eventtype
Auto commit by PR queue bot
parents
972abe68
9ff76597
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
1 deletion
+6
-1
conversion.go
pkg/api/v1/conversion.go
+2
-1
request.go
pkg/client/unversioned/request.go
+1
-0
strategy.go
pkg/registry/event/strategy.go
+1
-0
strategy_test.go
pkg/registry/event/strategy_test.go
+2
-0
No files found.
pkg/api/v1/conversion.go
View file @
c5924d20
...
@@ -112,7 +112,8 @@ func addConversionFuncs() {
...
@@ -112,7 +112,8 @@ func addConversionFuncs() {
"involvedObject.resourceVersion"
,
"involvedObject.resourceVersion"
,
"involvedObject.fieldPath"
,
"involvedObject.fieldPath"
,
"reason"
,
"reason"
,
"source"
:
"source"
,
"type"
:
return
label
,
value
,
nil
return
label
,
value
,
nil
default
:
default
:
return
""
,
""
,
fmt
.
Errorf
(
"field label not supported: %s"
,
label
)
return
""
,
""
,
fmt
.
Errorf
(
"field label not supported: %s"
,
label
)
...
...
pkg/client/unversioned/request.go
View file @
c5924d20
...
@@ -278,6 +278,7 @@ const (
...
@@ -278,6 +278,7 @@ const (
EventReason
=
"reason"
EventReason
=
"reason"
EventSource
=
"source"
EventSource
=
"source"
EventType
=
"type"
EventInvolvedKind
=
"involvedObject.kind"
EventInvolvedKind
=
"involvedObject.kind"
EventInvolvedNamespace
=
"involvedObject.namespace"
EventInvolvedNamespace
=
"involvedObject.namespace"
EventInvolvedName
=
"involvedObject.name"
EventInvolvedName
=
"involvedObject.name"
...
...
pkg/registry/event/strategy.go
View file @
c5924d20
...
@@ -95,6 +95,7 @@ func getAttrs(obj runtime.Object) (objLabels labels.Set, objFields fields.Set, e
...
@@ -95,6 +95,7 @@ func getAttrs(obj runtime.Object) (objLabels labels.Set, objFields fields.Set, e
"involvedObject.fieldPath"
:
event
.
InvolvedObject
.
FieldPath
,
"involvedObject.fieldPath"
:
event
.
InvolvedObject
.
FieldPath
,
"reason"
:
event
.
Reason
,
"reason"
:
event
.
Reason
,
"source"
:
event
.
Source
.
Component
,
"source"
:
event
.
Source
.
Component
,
"type"
:
event
.
Type
,
}
}
return
l
,
generic
.
MergeFieldsSets
(
objectMetaFieldsSet
,
specificFieldsSet
),
nil
return
l
,
generic
.
MergeFieldsSets
(
objectMetaFieldsSet
,
specificFieldsSet
),
nil
}
}
pkg/registry/event/strategy_test.go
View file @
c5924d20
...
@@ -57,6 +57,7 @@ func TestGetAttrs(t *testing.T) {
...
@@ -57,6 +57,7 @@ func TestGetAttrs(t *testing.T) {
},
},
Reason
:
"ForTesting"
,
Reason
:
"ForTesting"
,
Source
:
api
.
EventSource
{
Component
:
"test"
},
Source
:
api
.
EventSource
{
Component
:
"test"
},
Type
:
api
.
EventTypeNormal
,
}
}
label
,
field
,
err
:=
getAttrs
(
eventA
)
label
,
field
,
err
:=
getAttrs
(
eventA
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -77,6 +78,7 @@ func TestGetAttrs(t *testing.T) {
...
@@ -77,6 +78,7 @@ func TestGetAttrs(t *testing.T) {
"involvedObject.fieldPath"
:
""
,
"involvedObject.fieldPath"
:
""
,
"reason"
:
"ForTesting"
,
"reason"
:
"ForTesting"
,
"source"
:
"test"
,
"source"
:
"test"
,
"type"
:
api
.
EventTypeNormal
,
}
}
if
e
,
a
:=
expect
,
field
;
!
reflect
.
DeepEqual
(
e
,
a
)
{
if
e
,
a
:=
expect
,
field
;
!
reflect
.
DeepEqual
(
e
,
a
)
{
t
.
Errorf
(
"diff: %s"
,
util
.
ObjectDiff
(
e
,
a
))
t
.
Errorf
(
"diff: %s"
,
util
.
ObjectDiff
(
e
,
a
))
...
...
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