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
bc43e491
Commit
bc43e491
authored
Nov 25, 2016
by
bruceauyeung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename constant MaxPatchConflicts to maxRetryWhenPatchConflicts
Signed-off-by:
bruceauyeung
<
ouyang.qinhua@zte.com.cn
>
parent
545f749a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
resthandler.go
pkg/apiserver/resthandler.go
+3
-3
No files found.
pkg/apiserver/resthandler.go
View file @
bc43e491
...
@@ -93,8 +93,8 @@ func (scope *RequestScope) err(err error, w http.ResponseWriter, req *http.Reque
...
@@ -93,8 +93,8 @@ func (scope *RequestScope) err(err error, w http.ResponseWriter, req *http.Reque
// may be used to deserialize an options object to pass to the getter.
// may be used to deserialize an options object to pass to the getter.
type
getterFunc
func
(
ctx
api
.
Context
,
name
string
,
req
*
restful
.
Request
)
(
runtime
.
Object
,
error
)
type
getterFunc
func
(
ctx
api
.
Context
,
name
string
,
req
*
restful
.
Request
)
(
runtime
.
Object
,
error
)
//
MaxPatchConflicts is the maximum number of conflicts retry for
during a patch operation before returning failure
//
maxRetryWhenPatchConflicts is the maximum number of conflicts retry
during a patch operation before returning failure
const
Max
PatchConflicts
=
5
const
maxRetryWhen
PatchConflicts
=
5
// getResourceHandler is an HTTP handler function for get requests. It delegates to the
// getResourceHandler is an HTTP handler function for get requests. It delegates to the
// passed-in getterFunc to perform the actual get.
// passed-in getterFunc to perform the actual get.
...
@@ -645,7 +645,7 @@ func patchResource(
...
@@ -645,7 +645,7 @@ func patchResource(
return
finishRequest
(
timeout
,
func
()
(
runtime
.
Object
,
error
)
{
return
finishRequest
(
timeout
,
func
()
(
runtime
.
Object
,
error
)
{
updateObject
,
_
,
updateErr
:=
patcher
.
Update
(
ctx
,
name
,
updatedObjectInfo
)
updateObject
,
_
,
updateErr
:=
patcher
.
Update
(
ctx
,
name
,
updatedObjectInfo
)
for
i
:=
0
;
i
<
Max
PatchConflicts
&&
(
errors
.
IsConflict
(
updateErr
));
i
++
{
for
i
:=
0
;
i
<
maxRetryWhen
PatchConflicts
&&
(
errors
.
IsConflict
(
updateErr
));
i
++
{
lastConflictErr
=
updateErr
lastConflictErr
=
updateErr
updateObject
,
_
,
updateErr
=
patcher
.
Update
(
ctx
,
name
,
updatedObjectInfo
)
updateObject
,
_
,
updateErr
=
patcher
.
Update
(
ctx
,
name
,
updatedObjectInfo
)
}
}
...
...
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