custom-metrics: do cleanup even if the creation is not full succeed

Signed-off-by: pacoxu <paco.xu@daocloud.io>
This commit is contained in:
pacoxu 2021-06-28 17:09:02 +08:00
parent 657d93c4cc
commit be27d71eeb

View File

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