Skip to content

Commit

Permalink
Tests: Use DeletePropagationOrphan for ns
Browse files Browse the repository at this point in the history
- and longer timeout
- this doesn't work properly yet
- there's an issue with envtest
- more info: kubernetes-sigs/controller-runtime#880
  • Loading branch information
Jamashi committed Mar 25, 2021
1 parent 9c95e2b commit 1de412e
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions controllers/yumimap_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"k8s.io/apimachinery/pkg/types"

// ctrl "sigs.k8s.io/controller-runtime"

ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
)
Expand Down Expand Up @@ -305,12 +306,12 @@ var _ = Describe("YumiMap controller", func() {
}, timeout, interval).ShouldNot(Succeed())

By("Expecting sample namespaces to delete successfully")
gracePeriod := int64(0)
propagation := metav1.DeletePropagationBackground
// gracePeriod := int64(0)
propagation := metav1.DeletePropagationOrphan
for _, ns := range sampleNs {
err := k8sClient.Delete(context.Background(), &ns, &client.DeleteOptions{
GracePeriodSeconds: &gracePeriod,
PropagationPolicy: &propagation,
// GracePeriodSeconds: &gracePeriod,
PropagationPolicy: &propagation,
})
Expect(err).ToNot(HaveOccurred())
Eventually(func() error {
Expand All @@ -325,7 +326,7 @@ var _ = Describe("YumiMap controller", func() {

return nil

}, interval, 5*(timeout+time.Minute)).ShouldNot(Succeed())
}, timeout*15, interval).ShouldNot(Succeed())
}

})
Expand Down

0 comments on commit 1de412e

Please sign in to comment.