2023-05-08 19:36:35 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
2023-08-11 13:12:13 +00:00
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
2023-05-08 19:36:35 +00:00
|
|
|
|
|
|
|
package mesh
|
|
|
|
|
|
|
|
import (
|
2023-08-22 19:38:31 +00:00
|
|
|
"github.com/hashicorp/consul/internal/controller"
|
|
|
|
"github.com/hashicorp/consul/internal/mesh/internal/controllers"
|
2023-09-12 17:08:51 +00:00
|
|
|
"github.com/hashicorp/consul/internal/mesh/internal/controllers/routes"
|
2023-09-07 15:37:15 +00:00
|
|
|
"github.com/hashicorp/consul/internal/mesh/internal/controllers/sidecarproxy"
|
|
|
|
"github.com/hashicorp/consul/internal/mesh/internal/controllers/sidecarproxy/status"
|
2023-05-08 19:36:35 +00:00
|
|
|
"github.com/hashicorp/consul/internal/mesh/internal/types"
|
|
|
|
"github.com/hashicorp/consul/internal/resource"
|
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
2023-09-07 15:37:15 +00:00
|
|
|
// Controller statuses.
|
|
|
|
|
|
|
|
// Sidecar-proxy controller.
|
|
|
|
SidecarProxyStatusKey = sidecarproxy.ControllerName
|
|
|
|
SidecarProxyStatusConditionMeshDestination = status.StatusConditionDestinationAccepted
|
|
|
|
SidecarProxyStatusReasonNonMeshDestination = status.StatusReasonMeshProtocolNotFound
|
|
|
|
SidecarProxyStatusReasonMeshDestination = status.StatusReasonMeshProtocolFound
|
|
|
|
SidecarProxyStatusReasonDestinationServiceNotFound = status.StatusReasonDestinationServiceNotFound
|
|
|
|
SidecarProxyStatusReasonDestinationServiceFound = status.StatusReasonDestinationServiceFound
|
|
|
|
SidecarProxyStatusReasonMeshProtocolDestinationPort = status.StatusReasonMeshProtocolDestinationPort
|
|
|
|
SidecarProxyStatusReasonNonMeshProtocolDestinationPort = status.StatusReasonNonMeshProtocolDestinationPort
|
2023-09-12 17:08:51 +00:00
|
|
|
|
|
|
|
// Routes controller
|
|
|
|
RoutesStatusKey = routes.StatusKey
|
|
|
|
RoutesStatusConditionAccepted = routes.StatusConditionAccepted
|
|
|
|
RoutesStatusConditionAcceptedMissingParentRefReason = routes.MissingParentRefReason
|
|
|
|
RoutesStatusConditionAcceptedMissingBackendRefReason = routes.MissingBackendRefReason
|
|
|
|
RoutesStatusConditionAcceptedParentRefOutsideMeshReason = routes.ParentRefOutsideMeshReason
|
|
|
|
RoutesStatusConditionAcceptedBackendRefOutsideMeshReason = routes.BackendRefOutsideMeshReason
|
|
|
|
RoutesStatusConditionAcceptedParentRefUsingMeshPortReason = routes.ParentRefUsingMeshPortReason
|
|
|
|
RoutesStatusConditionAcceptedBackendRefUsingMeshPortReason = routes.BackendRefUsingMeshPortReason
|
|
|
|
RoutesStatusConditionAcceptedUnknownParentRefPortReason = routes.UnknownParentRefPortReason
|
|
|
|
RoutesStatusConditionAcceptedUnknownBackendRefPortReason = routes.UnknownBackendRefPortReason
|
|
|
|
RoutesStatusConditionAcceptedConflictNotBoundToParentRefReason = routes.ConflictNotBoundToParentRefReason
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
// Important constants
|
|
|
|
|
|
|
|
NullRouteBackend = types.NullRouteBackend
|
2023-05-08 19:36:35 +00:00
|
|
|
)
|
|
|
|
|
2023-09-07 15:37:15 +00:00
|
|
|
// RegisterTypes adds all resource types within the "mesh" API group
|
2023-05-08 19:36:35 +00:00
|
|
|
// to the given type registry
|
|
|
|
func RegisterTypes(r resource.Registry) {
|
|
|
|
types.Register(r)
|
|
|
|
}
|
2023-08-22 19:38:31 +00:00
|
|
|
|
|
|
|
// RegisterControllers registers controllers for the mesh types with
|
|
|
|
// the given controller Manager.
|
|
|
|
func RegisterControllers(mgr *controller.Manager, deps ControllerDependencies) {
|
|
|
|
controllers.Register(mgr, deps)
|
|
|
|
}
|
|
|
|
|
2023-09-07 15:37:15 +00:00
|
|
|
type TrustDomainFetcher = sidecarproxy.TrustDomainFetcher
|
|
|
|
|
2023-08-22 19:38:31 +00:00
|
|
|
type ControllerDependencies = controllers.Dependencies
|