Skip to content

Commit

Permalink
Implement the service endpoints controller (hashicorp#17216)
Browse files Browse the repository at this point in the history
* Add a ReplaceType dep mapper and move them into their own file

* Implement the service endpoints controller

* Implement a Catalog Controllers Integration Test
  • Loading branch information
mkeeler authored Jun 6, 2023
1 parent 2dd5551 commit a5ba889
Show file tree
Hide file tree
Showing 92 changed files with 6,550 additions and 162 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ require (
go.opentelemetry.io/proto/otlp v0.19.0
go.uber.org/goleak v1.1.10
golang.org/x/crypto v0.1.0
golang.org/x/exp v0.0.0-20230321023759-10a507213a29
golang.org/x/net v0.10.0
golang.org/x/oauth2 v0.6.0
golang.org/x/sync v0.2.0
Expand Down Expand Up @@ -240,7 +241,6 @@ require (
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/otel/trace v1.16.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/term v0.8.0 // indirect
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"kind": "Service"
},
"tenancy": {
"partition": "default",
"namespace": "default",
"peer_name": "local"
},
"name": "api"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Service",
"workloads": {
"prefixes": [
"api-"
]
},
"ports": [
{
"target_port": "http",
"protocol": "PROTOCOL_HTTP"
},
{
"target_port": "grpc",
"protocol": "PROTOCOL_GRPC"
},
{
"target_port": "mesh",
"protocol": "PROTOCOL_MESH"
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"kind": "HealthStatus"
},
"tenancy": {
"partition": "default",
"namespace": "default",
"peer_name": "local"
},
"name": "api-1-health"
},
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"kind": "Workload"
},
"tenancy": {
"partition": "default",
"namespace": "default",
"peer_name": "local"
},
"name": "api-1"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_PASSING"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"kind": "Workload"
},
"tenancy": {
"partition": "default",
"namespace": "default",
"peer_name": "local"
},
"name": "api-1"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"addresses": [
{
"host": "172.16.1.1"
},
{
"host": "198.18.2.1",
"external": true,
"ports": [
"mesh"
]
}
],
"ports": {
"http": {
"port": 8080,
"protocol": "PROTOCOL_HTTP"
},
"grpc": {
"port": 9090,
"protocol": "PROTOCOL_GRPC"
},
"mesh": {
"port": 10000,
"protocol": "PROTOCOL_MESH"
}
},
"identity": "api",
"node_name": "node-1"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"kind": "HealthStatus"
},
"tenancy": {
"partition": "default",
"namespace": "default",
"peer_name": "local"
},
"name": "api-10-health"
},
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"kind": "Workload"
},
"tenancy": {
"partition": "default",
"namespace": "default",
"peer_name": "local"
},
"name": "api-10"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_WARNING"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"kind": "Workload"
},
"tenancy": {
"partition": "default",
"namespace": "default",
"peer_name": "local"
},
"name": "api-10"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"addresses": [
{
"host": "172.16.1.10"
},
{
"host": "198.18.2.10",
"external": true,
"ports": [
"mesh"
]
}
],
"ports": {
"http": {
"port": 8080,
"protocol": "PROTOCOL_HTTP"
},
"grpc": {
"port": 9090,
"protocol": "PROTOCOL_GRPC"
},
"mesh": {
"port": 10000,
"protocol": "PROTOCOL_MESH"
}
},
"identity": "api",
"node_name": "node-3"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"kind": "HealthStatus"
},
"tenancy": {
"partition": "default",
"namespace": "default",
"peer_name": "local"
},
"name": "api-11-health"
},
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"kind": "Workload"
},
"tenancy": {
"partition": "default",
"namespace": "default",
"peer_name": "local"
},
"name": "api-11"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_CRITICAL"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"kind": "Workload"
},
"tenancy": {
"partition": "default",
"namespace": "default",
"peer_name": "local"
},
"name": "api-11"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"addresses": [
{
"host": "172.16.1.11"
},
{
"host": "198.18.2.11",
"external": true,
"ports": [
"mesh"
]
}
],
"ports": {
"http": {
"port": 8080,
"protocol": "PROTOCOL_HTTP"
},
"grpc": {
"port": 9090,
"protocol": "PROTOCOL_GRPC"
},
"mesh": {
"port": 10000,
"protocol": "PROTOCOL_MESH"
}
},
"identity": "api",
"node_name": "node-3"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"kind": "HealthStatus"
},
"tenancy": {
"partition": "default",
"namespace": "default",
"peer_name": "local"
},
"name": "api-12-health"
},
"owner": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"kind": "Workload"
},
"tenancy": {
"partition": "default",
"namespace": "default",
"peer_name": "local"
},
"name": "api-12"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.HealthStatus",
"type": "synthetic",
"status": "HEALTH_MAINTENANCE"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"id": {
"type": {
"group": "catalog",
"group_version": "v1alpha1",
"kind": "Workload"
},
"tenancy": {
"partition": "default",
"namespace": "default",
"peer_name": "local"
},
"name": "api-12"
},
"data": {
"@type": "hashicorp.consul.catalog.v1alpha1.Workload",
"addresses": [
{
"host": "172.16.1.12"
},
{
"host": "198.18.2.12",
"external": true,
"ports": [
"mesh"
]
}
],
"ports": {
"http": {
"port": 8080,
"protocol": "PROTOCOL_HTTP"
},
"grpc": {
"port": 9090,
"protocol": "PROTOCOL_GRPC"
},
"mesh": {
"port": 10000,
"protocol": "PROTOCOL_MESH"
}
},
"identity": "api",
"node_name": "node-3"
}
}
Loading

0 comments on commit a5ba889

Please sign in to comment.