mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
fix(kubernetes): detect metrics API for kubernetes endspoints EE-4865 (#8351)
This commit is contained in:
parent
a74e389521
commit
087848539f
5 changed files with 50 additions and 1 deletions
|
@ -7,6 +7,7 @@ import (
|
|||
"github.com/portainer/libhttp/request"
|
||||
"github.com/portainer/libhttp/response"
|
||||
portainer "github.com/portainer/portainer/api"
|
||||
"github.com/portainer/portainer/api/internal/endpointutils"
|
||||
)
|
||||
|
||||
// @id EndpointInspect
|
||||
|
@ -51,6 +52,15 @@ func (handler *Handler) endpointInspect(w http.ResponseWriter, r *http.Request)
|
|||
}
|
||||
}
|
||||
|
||||
isServerMetricsDetected := endpoint.Kubernetes.Flags.IsServerMetricsDetected
|
||||
if !isServerMetricsDetected && handler.K8sClientFactory != nil {
|
||||
endpointutils.InitialMetricsDetection(
|
||||
endpoint,
|
||||
handler.DataStore.Endpoint(),
|
||||
handler.K8sClientFactory,
|
||||
)
|
||||
}
|
||||
|
||||
return response.JSON(w, endpoint)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue