Skip to content

Commit

Permalink
Implement a Catalog Controllers Integration Test
Browse files Browse the repository at this point in the history
This also fixes a bug where multiple service ports with a 0 value virtual port could not be set. A 0 virtual port means unset and so we should allow duplicates of these.
  • Loading branch information
mkeeler committed May 23, 2023
1 parent 1fae2f4 commit 0c553de
Show file tree
Hide file tree
Showing 62 changed files with 2,965 additions and 35 deletions.
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 0c553de

Please sign in to comment.