mirror of https://github.com/k3s-io/k3s
switch delete strategy to background deletion
parent
43b59986f4
commit
ebd48f26e5
|
@ -240,7 +240,7 @@ func (o *DeleteOptions) DeleteResult(r *resource.Result) error {
|
||||||
if o.GracePeriod >= 0 {
|
if o.GracePeriod >= 0 {
|
||||||
options = metav1.NewDeleteOptions(int64(o.GracePeriod))
|
options = metav1.NewDeleteOptions(int64(o.GracePeriod))
|
||||||
}
|
}
|
||||||
policy := metav1.DeletePropagationForeground
|
policy := metav1.DeletePropagationBackground
|
||||||
if !o.Cascade {
|
if !o.Cascade {
|
||||||
policy = metav1.DeletePropagationOrphan
|
policy = metav1.DeletePropagationOrphan
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,9 +137,9 @@ func TestOrphanDependentsInDeleteObject(t *testing.T) {
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteOptions.PropagationPolicy should be Foreground, when cascade is true (default).
|
// DeleteOptions.PropagationPolicy should be Background, when cascade is true (default).
|
||||||
foregroundPolicy := metav1.DeletePropagationForeground
|
backgroundPolicy := metav1.DeletePropagationBackground
|
||||||
policy = &foregroundPolicy
|
policy = &backgroundPolicy
|
||||||
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
streams, _, buf, _ := genericclioptions.NewTestIOStreams()
|
||||||
cmd := NewCmdDelete(tf, streams)
|
cmd := NewCmdDelete(tf, streams)
|
||||||
cmd.Flags().Set("namespace", "test")
|
cmd.Flags().Set("namespace", "test")
|
||||||
|
|
Loading…
Reference in New Issue