switch delete strategy to background deletion

pull/8/head
juanvallejo 2018-07-06 11:36:57 -04:00
parent 43b59986f4
commit ebd48f26e5
No known key found for this signature in database
GPG Key ID: 7D2C958002D6448D
2 changed files with 4 additions and 4 deletions

View File

@ -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
} }

View File

@ -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")