From bc43e4913d3017e70118f552378076c933537e6f Mon Sep 17 00:00:00 2001 From: bruceauyeung Date: Fri, 25 Nov 2016 11:12:04 +0800 Subject: [PATCH] rename constant MaxPatchConflicts to maxRetryWhenPatchConflicts Signed-off-by: bruceauyeung --- pkg/apiserver/resthandler.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/apiserver/resthandler.go b/pkg/apiserver/resthandler.go index 575af989e08..8f246b7459c 100644 --- a/pkg/apiserver/resthandler.go +++ b/pkg/apiserver/resthandler.go @@ -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. 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 -const MaxPatchConflicts = 5 +// maxRetryWhenPatchConflicts is the maximum number of conflicts retry during a patch operation before returning failure +const maxRetryWhenPatchConflicts = 5 // getResourceHandler is an HTTP handler function for get requests. It delegates to the // passed-in getterFunc to perform the actual get. @@ -645,7 +645,7 @@ func patchResource( return finishRequest(timeout, func() (runtime.Object, error) { updateObject, _, updateErr := patcher.Update(ctx, name, updatedObjectInfo) - for i := 0; i < MaxPatchConflicts && (errors.IsConflict(updateErr)); i++ { + for i := 0; i < maxRetryWhenPatchConflicts && (errors.IsConflict(updateErr)); i++ { lastConflictErr = updateErr updateObject, _, updateErr = patcher.Update(ctx, name, updatedObjectInfo) }