1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 23:09:41 +02:00

feat(kubernetes): cluster setup reasonable defaults EE-4518 (#8082)

This commit is contained in:
Dakota Walsh 2022-12-16 16:03:40 +13:00 committed by GitHub
parent 0436be7bc4
commit 046738c967
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 168 additions and 3 deletions

View file

@ -17,6 +17,7 @@ import (
"github.com/portainer/portainer/api/crypto"
"github.com/portainer/portainer/api/http/client"
"github.com/portainer/portainer/api/internal/edge"
"github.com/portainer/portainer/api/internal/endpointutils"
)
type endpointCreatePayload struct {
@ -244,6 +245,22 @@ func (handler *Handler) endpointCreate(w http.ResponseWriter, r *http.Request) *
for _, stackID := range relatedEdgeStacks {
relationObject.EdgeStacks[stackID] = true
}
} else if endpointutils.IsKubernetesEndpoint(endpoint) {
endpointutils.InitialIngressClassDetection(
endpoint,
handler.DataStore.Endpoint(),
handler.K8sClientFactory,
)
endpointutils.InitialMetricsDetection(
endpoint,
handler.DataStore.Endpoint(),
handler.K8sClientFactory,
)
endpointutils.InitialStorageDetection(
endpoint,
handler.DataStore.Endpoint(),
handler.K8sClientFactory,
)
}
err = handler.DataStore.EndpointRelation().Create(relationObject)