mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 14:14:39 +00:00
pin ResourceVersion precondition only when specified
This commit is contained in:
@@ -147,9 +147,7 @@ func (r *REST) Delete(ctx context.Context, name string, options *metav1.DeleteOp
|
||||
)
|
||||
return nil, false, err
|
||||
}
|
||||
if options.Preconditions.ResourceVersion == nil {
|
||||
options.Preconditions.ResourceVersion = &namespace.ResourceVersion
|
||||
} else if *options.Preconditions.ResourceVersion != namespace.ResourceVersion {
|
||||
if options.Preconditions.ResourceVersion != nil && *options.Preconditions.ResourceVersion != namespace.ResourceVersion {
|
||||
err = apierrors.NewConflict(
|
||||
api.Resource("namespaces"),
|
||||
name,
|
||||
|
@@ -92,9 +92,7 @@ func (r *REST) Delete(ctx context.Context, name string, options *metav1.DeleteOp
|
||||
)
|
||||
return nil, false, err
|
||||
}
|
||||
if options.Preconditions.ResourceVersion == nil {
|
||||
options.Preconditions.ResourceVersion = &crd.ResourceVersion
|
||||
} else if *options.Preconditions.ResourceVersion != crd.ResourceVersion {
|
||||
if options.Preconditions.ResourceVersion != nil && *options.Preconditions.ResourceVersion != crd.ResourceVersion {
|
||||
err = apierrors.NewConflict(
|
||||
apiextensions.Resource("customresourcedefinitions"),
|
||||
name,
|
||||
|
Reference in New Issue
Block a user