mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 23:37:01 +00:00
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>
This commit is contained in:
parent
89a76b8c8b
commit
08fcd79e1f
@ -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
Block a user