mirror of
https://github.com/portainer/portainer.git
synced 2025-08-10 08:15:25 +02:00
guard around kube actions for endpoint inspect
This commit is contained in:
parent
2216d2cdd2
commit
59141ec37d
1 changed files with 17 additions and 15 deletions
|
@ -52,22 +52,24 @@ func (handler *Handler) endpointInspect(w http.ResponseWriter, r *http.Request)
|
|||
}
|
||||
}
|
||||
|
||||
isServerMetricsDetected := endpoint.Kubernetes.Flags.IsServerMetricsDetected
|
||||
if endpointutils.IsKubernetesEndpoint(endpoint) && !isServerMetricsDetected && handler.K8sClientFactory != nil {
|
||||
endpointutils.InitialMetricsDetection(
|
||||
endpoint,
|
||||
handler.DataStore.Endpoint(),
|
||||
handler.K8sClientFactory,
|
||||
)
|
||||
}
|
||||
if endpointutils.IsKubernetesEndpoint(endpoint) {
|
||||
isServerMetricsDetected := endpoint.Kubernetes.Flags.IsServerMetricsDetected
|
||||
if !isServerMetricsDetected && handler.K8sClientFactory != nil {
|
||||
endpointutils.InitialMetricsDetection(
|
||||
endpoint,
|
||||
handler.DataStore.Endpoint(),
|
||||
handler.K8sClientFactory,
|
||||
)
|
||||
}
|
||||
|
||||
isServerStorageDetected := endpoint.Kubernetes.Flags.IsServerStorageDetected
|
||||
if !isServerStorageDetected && handler.K8sClientFactory != nil {
|
||||
endpointutils.InitialStorageDetection(
|
||||
endpoint,
|
||||
handler.DataStore.Endpoint(),
|
||||
handler.K8sClientFactory,
|
||||
)
|
||||
isServerStorageDetected := endpoint.Kubernetes.Flags.IsServerStorageDetected
|
||||
if !isServerStorageDetected && handler.K8sClientFactory != nil {
|
||||
endpointutils.InitialStorageDetection(
|
||||
endpoint,
|
||||
handler.DataStore.Endpoint(),
|
||||
handler.K8sClientFactory,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return response.JSON(w, endpoint)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue