Skip to content
Snippets Groups Projects
Commit 0f2eec98 authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

Enhance code quality by only catching specific exception typ

parent 8bb1c760
No related branches found
No related tags found
1 merge request!262Make the clean up of ServiceMonitors optional when Operator is starting
Pipeline #7566 passed
package theodolite.execution.operator
import io.fabric8.kubernetes.client.KubernetesClientException
import io.fabric8.kubernetes.client.NamespacedKubernetesClient
import io.fabric8.kubernetes.client.dsl.MixedOperation
import io.fabric8.kubernetes.client.dsl.Resource
......@@ -84,8 +85,9 @@ class ClusterSetup(
labelValue = "theodolite",
context = serviceMonitorContext
)
} catch (e: Exception) {
} catch (e: KubernetesClientException) {
logger.warn { "Service monitors could not be cleaned up. It may be that service monitors are not registered by the Kubernetes API."}
logger.debug { "Error is: ${e.message}" }
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment