diff --git a/pkg/metrics/providers/keptn.go b/pkg/metrics/providers/keptn.go index 0720a0709..e0f5ecc0e 100644 --- a/pkg/metrics/providers/keptn.go +++ b/pkg/metrics/providers/keptn.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "k8s.io/klog/v2" "strconv" "strings" "time" @@ -153,7 +154,7 @@ func (k *KeptnProvider) queryKeptnAnalysis(obj *queryObject) (float64, error) { // delete the created analysis at the end of the function defer func() { - _ = k.client. + err := k.client. Resource(obj.GroupVersionResource). Namespace(obj.Namespace). Delete( @@ -161,6 +162,9 @@ func (k *KeptnProvider) queryKeptnAnalysis(obj *queryObject) (float64, error) { createdAnalysis.GetName(), v1.DeleteOptions{}, ) + if err != nil { + klog.Error("Could not delete Keptn Analysis '%s': %v", createdAnalysis.GetName(), err) + } }() for {