-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a Catalog Controllers Integration Test
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
Showing
62 changed files
with
2,965 additions
and
35 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
internal/catalog/catalogtest/integration_test_data/v1alpha1/api-service.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
] | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
internal/catalog/catalogtest/integration_test_data/v1alpha1/api-workload-1-health.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
internal/catalog/catalogtest/integration_test_data/v1alpha1/api-workload-1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
internal/catalog/catalogtest/integration_test_data/v1alpha1/api-workload-10-health.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
internal/catalog/catalogtest/integration_test_data/v1alpha1/api-workload-10.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
internal/catalog/catalogtest/integration_test_data/v1alpha1/api-workload-11-health.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
internal/catalog/catalogtest/integration_test_data/v1alpha1/api-workload-11.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
internal/catalog/catalogtest/integration_test_data/v1alpha1/api-workload-12-health.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
internal/catalog/catalogtest/integration_test_data/v1alpha1/api-workload-12.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
Oops, something went wrong.