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
b3981a2f
Unverified
Commit
b3981a2f
authored
May 30, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
May 30, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #78482 from tedyu/evt-expansion
Check namespaces match in UpdateWithEventNamespace
parents
13ec0e2b
5990a7d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
event_expansion.go
...ent-go/kubernetes/typed/events/v1beta1/event_expansion.go
+4
-1
No files found.
staging/src/k8s.io/client-go/kubernetes/typed/events/v1beta1/event_expansion.go
View file @
b3981a2f
...
@@ -32,7 +32,7 @@ type EventExpansion interface {
...
@@ -32,7 +32,7 @@ type EventExpansion interface {
// UpdateWithEventNamespace is the same as a Update
// UpdateWithEventNamespace is the same as a Update
// except that it sends the request to the event.Namespace.
// except that it sends the request to the event.Namespace.
UpdateWithEventNamespace
(
event
*
v1beta1
.
Event
)
(
*
v1beta1
.
Event
,
error
)
UpdateWithEventNamespace
(
event
*
v1beta1
.
Event
)
(
*
v1beta1
.
Event
,
error
)
// PatchWithEventNamespace is the same as a Update
// PatchWithEventNamespace is the same as a
n
Update
// except that it sends the request to the event.Namespace.
// except that it sends the request to the event.Namespace.
PatchWithEventNamespace
(
event
*
v1beta1
.
Event
,
data
[]
byte
)
(
*
v1beta1
.
Event
,
error
)
PatchWithEventNamespace
(
event
*
v1beta1
.
Event
,
data
[]
byte
)
(
*
v1beta1
.
Event
,
error
)
}
}
...
@@ -63,6 +63,9 @@ func (e *events) CreateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event,
...
@@ -63,6 +63,9 @@ func (e *events) CreateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event,
// created with the "" namespace.
// created with the "" namespace.
// Update also requires the ResourceVersion to be set in the event object.
// Update also requires the ResourceVersion to be set in the event object.
func
(
e
*
events
)
UpdateWithEventNamespace
(
event
*
v1beta1
.
Event
)
(
*
v1beta1
.
Event
,
error
)
{
func
(
e
*
events
)
UpdateWithEventNamespace
(
event
*
v1beta1
.
Event
)
(
*
v1beta1
.
Event
,
error
)
{
if
e
.
ns
!=
""
&&
event
.
Namespace
!=
e
.
ns
{
return
nil
,
fmt
.
Errorf
(
"can't update an event with namespace '%v' in namespace '%v'"
,
event
.
Namespace
,
e
.
ns
)
}
result
:=
&
v1beta1
.
Event
{}
result
:=
&
v1beta1
.
Event
{}
err
:=
e
.
client
.
Put
()
.
err
:=
e
.
client
.
Put
()
.
NamespaceIfScoped
(
event
.
Namespace
,
len
(
event
.
Namespace
)
>
0
)
.
NamespaceIfScoped
(
event
.
Namespace
,
len
(
event
.
Namespace
)
>
0
)
.
...
...
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