mirror of
https://github.com/portainer/portainer.git
synced 2025-07-29 18:29:44 +02:00
guard around kube actions for endpoint inspect (#8430)
This commit is contained in:
parent
2dddc1c6b9
commit
e2168d21c7
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) {
|
||||||
if endpointutils.IsKubernetesEndpoint(endpoint) && !isServerMetricsDetected && handler.K8sClientFactory != nil {
|
isServerMetricsDetected := endpoint.Kubernetes.Flags.IsServerMetricsDetected
|
||||||
endpointutils.InitialMetricsDetection(
|
if !isServerMetricsDetected && handler.K8sClientFactory != nil {
|
||||||
endpoint,
|
endpointutils.InitialMetricsDetection(
|
||||||
handler.DataStore.Endpoint(),
|
endpoint,
|
||||||
handler.K8sClientFactory,
|
handler.DataStore.Endpoint(),
|
||||||
)
|
handler.K8sClientFactory,
|
||||||
}
|
)
|
||||||
|
}
|
||||||
|
|
||||||
isServerStorageDetected := endpoint.Kubernetes.Flags.IsServerStorageDetected
|
isServerStorageDetected := endpoint.Kubernetes.Flags.IsServerStorageDetected
|
||||||
if !isServerStorageDetected && handler.K8sClientFactory != nil {
|
if !isServerStorageDetected && handler.K8sClientFactory != nil {
|
||||||
endpointutils.InitialStorageDetection(
|
endpointutils.InitialStorageDetection(
|
||||||
endpoint,
|
endpoint,
|
||||||
handler.DataStore.Endpoint(),
|
handler.DataStore.Endpoint(),
|
||||||
handler.K8sClientFactory,
|
handler.K8sClientFactory,
|
||||||
)
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return response.JSON(w, endpoint)
|
return response.JSON(w, endpoint)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue