Require DeleteStrategy for all registry.Store
All registry.Store objects already set a non-nil DeleteStrategy. This change ensures that all future objects do so as well. Signed-off-by: Monis Khan <mkhan@redhat.com> Kubernetes-commit: 08fcd79e1f4b9d3efe0a20ea4ce4fdf5ffea0531
This commit is contained in:
parent
2f49bbbf91
commit
844a0a7812
|
|
@ -143,8 +143,7 @@ type Store struct {
|
|||
// AfterUpdate implements a further operation to run after a resource is
|
||||
// updated and before it is decorated, optional.
|
||||
AfterUpdate ObjectFunc
|
||||
// DeleteStrategy implements resource-specific behavior during deletion,
|
||||
// optional.
|
||||
// DeleteStrategy implements resource-specific behavior during deletion.
|
||||
DeleteStrategy rest.RESTDeleteStrategy
|
||||
// AfterDelete implements a further operation to run after a resource is
|
||||
// deleted and before it is decorated, optional.
|
||||
|
|
@ -1138,6 +1137,10 @@ func (e *Store) CompleteWithOptions(options *generic.StoreOptions) error {
|
|||
return fmt.Errorf("store for %s must have CreateStrategy or UpdateStrategy set", e.QualifiedResource.String())
|
||||
}
|
||||
|
||||
if e.DeleteStrategy == nil {
|
||||
return fmt.Errorf("store for %s must have DeleteStrategy set", e.QualifiedResource.String())
|
||||
}
|
||||
|
||||
if options.RESTOptions == nil {
|
||||
return fmt.Errorf("options for %s must have RESTOptions set", e.QualifiedResource.String())
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue