kubernetes-sigs / kubetest2

Kubetest2 is the framework for launching and running end-to-end tests on Kubernetes.
Apache License 2.0
331 stars 106 forks source link

Kubetest2 doesn not down on ginkgo failures #188

Closed olemarkus closed 2 years ago

olemarkus commented 2 years ago

Previously, kubetest2 would have a defer shouldDown() that ensured clusters were always cleaned up after run regardless of outcome given that --down flag was supplied.

https://github.com/kubernetes-sigs/kubetest2/commit/d9ca6c849f1e275cc5b98c1248bfeb24e72c684a seems to have removed that defer and instead only ensures down is executed on certain signals. If ginkgo returns an error, shouldDown will never be run.

The effect of this is rather massive resource leakage in the kOps AWS account.

We'd like to understand if this is intended behavior or if this is a bug.

/cc @ShwethaKumbla

ShwethaKumbla commented 2 years ago

@olemarkus there was a concern that down will be called multiple times in case of any signal failure so defer is removed. reference : https://github.com/kubernetes-sigs/kubetest2/pull/148#pullrequestreview-809265013

@amwat As we removed defer, looks like suppling --down flag is mandatory as clusters are not teared down in case of ginkgo errors. Could you please confirm what should be the behaviour ?