Merge pull request #26378 from pwittrock/fix-26138
Automatic merge from submit-queue Retry concurrency exceptions in e2e/kubectl.go. Fixes #26138 []()
This commit is contained in:
@@ -122,6 +122,8 @@ type Store struct {
|
||||
Storage storage.Interface
|
||||
}
|
||||
|
||||
const OptimisticLockErrorMsg = "the object has been modified; please apply your changes to the latest version and try again"
|
||||
|
||||
// NamespaceKeyRootFunc is the default function for constructing storage paths to resource directories enforcing namespace rules.
|
||||
func NamespaceKeyRootFunc(ctx api.Context, prefix string) string {
|
||||
key := prefix
|
||||
@@ -364,7 +366,7 @@ func (e *Store) Update(ctx api.Context, name string, objInfo rest.UpdatedObjectI
|
||||
return nil, nil, kubeerr.NewInvalid(qualifiedKind, name, fieldErrList)
|
||||
}
|
||||
if newVersion != version {
|
||||
return nil, nil, kubeerr.NewConflict(e.QualifiedResource, name, fmt.Errorf("the object has been modified; please apply your changes to the latest version and try again"))
|
||||
return nil, nil, kubeerr.NewConflict(e.QualifiedResource, name, fmt.Errorf(OptimisticLockErrorMsg))
|
||||
}
|
||||
}
|
||||
if err := rest.BeforeUpdate(e.UpdateStrategy, ctx, obj, existing); err != nil {
|
||||
|
Reference in New Issue
Block a user