mirror of
https://github.com/status-im/consul.git
synced 2025-02-08 20:05:09 +00:00
Net 7155- Consul API Gateway Controller Stub Work (#20324)
* API Gateway proto * fix lint issue * new line * run make proto format * checkpoint * stub * Update internal/mesh/internal/controllers/apigateways/controller.go
This commit is contained in:
parent
840f11a0c5
commit
37ebaa6920
@ -22,6 +22,7 @@ flowchart TD
|
|||||||
demo/v2/artist
|
demo/v2/artist
|
||||||
hcp/v2/link
|
hcp/v2/link
|
||||||
internal/v1/tombstone
|
internal/v1/tombstone
|
||||||
|
mesh/v2beta1/apigateway
|
||||||
mesh/v2beta1/computedexplicitdestinations --> catalog/v2beta1/service
|
mesh/v2beta1/computedexplicitdestinations --> catalog/v2beta1/service
|
||||||
mesh/v2beta1/computedexplicitdestinations --> catalog/v2beta1/workload
|
mesh/v2beta1/computedexplicitdestinations --> catalog/v2beta1/workload
|
||||||
mesh/v2beta1/computedexplicitdestinations --> mesh/v2beta1/computedroutes
|
mesh/v2beta1/computedexplicitdestinations --> mesh/v2beta1/computedroutes
|
||||||
|
34
internal/mesh/internal/controllers/apigateways/controller.go
Normal file
34
internal/mesh/internal/controllers/apigateways/controller.go
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// Copyright (c) HashiCorp, Inc.
|
||||||
|
// SPDX-License-Identifier: BUSL-1.1
|
||||||
|
|
||||||
|
package apigateways
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/hashicorp/consul/internal/controller"
|
||||||
|
pbmesh "github.com/hashicorp/consul/proto-public/pbmesh/v2beta1"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
ControllerName = "consul.io/api-gateway"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Controller() *controller.Controller {
|
||||||
|
r := &reconciler{}
|
||||||
|
|
||||||
|
return controller.NewController(ControllerName, pbmesh.APIGatewayType).
|
||||||
|
WithReconciler(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
type reconciler struct{}
|
||||||
|
|
||||||
|
// Reconcile is responsible for creating a Service w/ a MeshGateway owner,
|
||||||
|
// in addition to other things discussed in the RFC.
|
||||||
|
func (r *reconciler) Reconcile(ctx context.Context, rt controller.Runtime, req controller.Request) error {
|
||||||
|
rt.Logger = rt.Logger.With("resource-id", req.ID)
|
||||||
|
rt.Logger.Trace("reconciling api gateway")
|
||||||
|
|
||||||
|
//TODO NET-7378
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
@ -5,6 +5,7 @@ package controllers
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"github.com/hashicorp/consul/internal/mesh/internal/controllers/apigateways"
|
||||||
|
|
||||||
"github.com/hashicorp/consul/internal/mesh/internal/controllers/gatewayproxy"
|
"github.com/hashicorp/consul/internal/mesh/internal/controllers/gatewayproxy"
|
||||||
"github.com/hashicorp/consul/internal/mesh/internal/controllers/meshconfiguration"
|
"github.com/hashicorp/consul/internal/mesh/internal/controllers/meshconfiguration"
|
||||||
@ -57,4 +58,5 @@ func Register(mgr *controller.Manager, deps Dependencies) {
|
|||||||
|
|
||||||
mgr.Register(meshgateways.Controller())
|
mgr.Register(meshgateways.Controller())
|
||||||
mgr.Register(meshconfiguration.Controller())
|
mgr.Register(meshconfiguration.Controller())
|
||||||
|
mgr.Register(apigateways.Controller())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user