mirror of
https://github.com/kubernetes/client-go.git
synced 2025-08-11 20:21:34 +00:00
Pass DeleteOptions down to the Reactor
Co-authored-by: Mo Khan <theenjeru@gmail.com> Kubernetes-commit: 621970476f8f06419716325d573580be7b3378d9
This commit is contained in:
parent
2f5d8b0c52
commit
d478a5752d
@ -222,10 +222,15 @@ func NewUpdateSubresourceAction(resource schema.GroupVersionResource, subresourc
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewRootDeleteAction(resource schema.GroupVersionResource, name string) DeleteActionImpl {
|
func NewRootDeleteAction(resource schema.GroupVersionResource, name string) DeleteActionImpl {
|
||||||
|
return NewRootDeleteActionWithOptions(resource, name, metav1.DeleteOptions{})
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewRootDeleteActionWithOptions(resource schema.GroupVersionResource, name string, opts metav1.DeleteOptions) DeleteActionImpl {
|
||||||
action := DeleteActionImpl{}
|
action := DeleteActionImpl{}
|
||||||
action.Verb = "delete"
|
action.Verb = "delete"
|
||||||
action.Resource = resource
|
action.Resource = resource
|
||||||
action.Name = name
|
action.Name = name
|
||||||
|
action.DeleteOptions = opts
|
||||||
|
|
||||||
return action
|
return action
|
||||||
}
|
}
|
||||||
@ -241,11 +246,16 @@ func NewRootDeleteSubresourceAction(resource schema.GroupVersionResource, subres
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewDeleteAction(resource schema.GroupVersionResource, namespace, name string) DeleteActionImpl {
|
func NewDeleteAction(resource schema.GroupVersionResource, namespace, name string) DeleteActionImpl {
|
||||||
|
return NewDeleteActionWithOptions(resource, namespace, name, metav1.DeleteOptions{})
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewDeleteActionWithOptions(resource schema.GroupVersionResource, namespace, name string, opts metav1.DeleteOptions) DeleteActionImpl {
|
||||||
action := DeleteActionImpl{}
|
action := DeleteActionImpl{}
|
||||||
action.Verb = "delete"
|
action.Verb = "delete"
|
||||||
action.Resource = resource
|
action.Resource = resource
|
||||||
action.Namespace = namespace
|
action.Namespace = namespace
|
||||||
action.Name = name
|
action.Name = name
|
||||||
|
action.DeleteOptions = opts
|
||||||
|
|
||||||
return action
|
return action
|
||||||
}
|
}
|
||||||
@ -391,6 +401,7 @@ type UpdateAction interface {
|
|||||||
type DeleteAction interface {
|
type DeleteAction interface {
|
||||||
Action
|
Action
|
||||||
GetName() string
|
GetName() string
|
||||||
|
GetDeleteOptions() metav1.DeleteOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteCollectionAction interface {
|
type DeleteCollectionAction interface {
|
||||||
@ -583,17 +594,23 @@ func (a PatchActionImpl) DeepCopy() Action {
|
|||||||
|
|
||||||
type DeleteActionImpl struct {
|
type DeleteActionImpl struct {
|
||||||
ActionImpl
|
ActionImpl
|
||||||
Name string
|
Name string
|
||||||
|
DeleteOptions metav1.DeleteOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a DeleteActionImpl) GetName() string {
|
func (a DeleteActionImpl) GetName() string {
|
||||||
return a.Name
|
return a.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (a DeleteActionImpl) GetDeleteOptions() metav1.DeleteOptions {
|
||||||
|
return a.DeleteOptions
|
||||||
|
}
|
||||||
|
|
||||||
func (a DeleteActionImpl) DeepCopy() Action {
|
func (a DeleteActionImpl) DeepCopy() Action {
|
||||||
return DeleteActionImpl{
|
return DeleteActionImpl{
|
||||||
ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl),
|
ActionImpl: a.ActionImpl.DeepCopy().(ActionImpl),
|
||||||
Name: a.Name,
|
Name: a.Name,
|
||||||
|
DeleteOptions: *a.DeleteOptions.DeepCopy(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user