mirror of https://github.com/k3s-io/k3s
pin ResourceVersion precondition only when specified
parent
63f4827fca
commit
4ddc198c39
|
@ -147,9 +147,7 @@ func (r *REST) Delete(ctx context.Context, name string, options *metav1.DeleteOp
|
||||||
)
|
)
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
if options.Preconditions.ResourceVersion == nil {
|
if options.Preconditions.ResourceVersion != nil && *options.Preconditions.ResourceVersion != namespace.ResourceVersion {
|
||||||
options.Preconditions.ResourceVersion = &namespace.ResourceVersion
|
|
||||||
} else if *options.Preconditions.ResourceVersion != namespace.ResourceVersion {
|
|
||||||
err = apierrors.NewConflict(
|
err = apierrors.NewConflict(
|
||||||
api.Resource("namespaces"),
|
api.Resource("namespaces"),
|
||||||
name,
|
name,
|
||||||
|
|
|
@ -92,9 +92,7 @@ func (r *REST) Delete(ctx context.Context, name string, options *metav1.DeleteOp
|
||||||
)
|
)
|
||||||
return nil, false, err
|
return nil, false, err
|
||||||
}
|
}
|
||||||
if options.Preconditions.ResourceVersion == nil {
|
if options.Preconditions.ResourceVersion != nil && *options.Preconditions.ResourceVersion != crd.ResourceVersion {
|
||||||
options.Preconditions.ResourceVersion = &crd.ResourceVersion
|
|
||||||
} else if *options.Preconditions.ResourceVersion != crd.ResourceVersion {
|
|
||||||
err = apierrors.NewConflict(
|
err = apierrors.NewConflict(
|
||||||
apiextensions.Resource("customresourcedefinitions"),
|
apiextensions.Resource("customresourcedefinitions"),
|
||||||
name,
|
name,
|
||||||
|
|
Loading…
Reference in New Issue