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

Ensure Down can run on build and test failure #189

Closed olemarkus closed 2 years ago

olemarkus commented 2 years ago

Add the down logic back into a defer so that resources are cleaned up on cluster up and test failures. Fixes #188 Fixes https://github.com/kubernetes/kops/issues/13349

hakman commented 2 years ago

/lgtm

hakman commented 2 years ago

This reverts part of https://github.com/kubernetes-sigs/kubetest2/pull/148. /cc @ShwethaKumbla @amwat

olemarkus commented 2 years ago

I see that the defer was removed out of a concern that down will be called multiple times. But since os.Exit is called, this should not be the case. os.Exit will not call deferred functions.

BenTheElder commented 2 years ago

/approve

k8s-ci-robot commented 2 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder, olemarkus

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/kubetest2/blob/master/OWNERS)~~ [BenTheElder] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment