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
87de76fa
Commit
87de76fa
authored
Apr 23, 2018
by
fisherxu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove repeated resourceversion
parent
a0844c17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
store.go
...c/k8s.io/apiserver/pkg/registry/generic/registry/store.go
+3
-7
No files found.
staging/src/k8s.io/apiserver/pkg/registry/generic/registry/store.go
View file @
87de76fa
...
...
@@ -585,19 +585,15 @@ func (e *Store) Update(ctx genericapirequest.Context, name string, objInfo rest.
}
else
{
// Check if the object's resource version matches the latest
// resource version.
newVersion
,
err
:=
e
.
Storage
.
Versioner
()
.
ObjectResourceVersion
(
obj
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
if
newVersion
==
0
{
if
resourceVersion
==
0
{
// TODO: The Invalid error should have a field for Resource.
// After that field is added, we should fill the Resource and
// leave the Kind field empty. See the discussion in #18526.
qualifiedKind
:=
schema
.
GroupKind
{
Group
:
qualifiedResource
.
Group
,
Kind
:
qualifiedResource
.
Resource
}
fieldErrList
:=
field
.
ErrorList
{
field
.
Invalid
(
field
.
NewPath
(
"metadata"
)
.
Child
(
"resourceVersion"
),
new
Version
,
"must be specified for an update"
)}
fieldErrList
:=
field
.
ErrorList
{
field
.
Invalid
(
field
.
NewPath
(
"metadata"
)
.
Child
(
"resourceVersion"
),
resource
Version
,
"must be specified for an update"
)}
return
nil
,
nil
,
kubeerr
.
NewInvalid
(
qualifiedKind
,
name
,
fieldErrList
)
}
if
new
Version
!=
version
{
if
resource
Version
!=
version
{
return
nil
,
nil
,
kubeerr
.
NewConflict
(
qualifiedResource
,
name
,
fmt
.
Errorf
(
OptimisticLockErrorMsg
))
}
}
...
...
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