From be27d71eebd9cadb2097e4ed83d06f08ad3d38d2 Mon Sep 17 00:00:00 2001 From: pacoxu Date: Mon, 28 Jun 2021 17:09:02 +0800 Subject: [PATCH] custom-metrics: do cleanup even if the creation is not full succeed Signed-off-by: pacoxu --- test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go b/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go index a16a0c4e7d0..69d6c9e2e93 100644 --- a/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go +++ b/test/e2e/autoscaling/custom_metrics_stackdriver_autoscaling.go @@ -264,10 +264,10 @@ func (tc *CustomMetricTestCase) Run() { defer monitoring.CleanupDescriptors(gcmService, projectID) err = monitoring.CreateAdapter(monitoring.AdapterDefault) + defer monitoring.CleanupAdapter(monitoring.AdapterDefault) if err != nil { framework.Failf("Failed to set up: %v", err) } - defer monitoring.CleanupAdapter(monitoring.AdapterDefault) // Run application that exports the metric err = createDeploymentToScale(tc.framework, tc.kubeClient, tc.deployment, tc.pod)