Skip to content

Commit

Permalink
Merge branch 'main' into NET-1594
Browse files Browse the repository at this point in the history
  • Loading branch information
absolutelightning authored Sep 1, 2023
2 parents 45c709c + 699aa47 commit ed8559c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
4 changes: 3 additions & 1 deletion internal/catalog/internal/types/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,9 @@ func validatePortName(name string) error {

func validateProtocol(protocol pbcatalog.Protocol) error {
switch protocol {
case pbcatalog.Protocol_PROTOCOL_TCP,
case pbcatalog.Protocol_PROTOCOL_UNSPECIFIED,
// means pbcatalog.FailoverMode_FAILOVER_MODE_TCP
pbcatalog.Protocol_PROTOCOL_TCP,
pbcatalog.Protocol_PROTOCOL_HTTP,
pbcatalog.Protocol_PROTOCOL_HTTP2,
pbcatalog.Protocol_PROTOCOL_GRPC,
Expand Down
20 changes: 20 additions & 0 deletions internal/catalog/internal/types/validators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,26 @@ func TestValidatePortName(t *testing.T) {
})
}

func TestValidateProtocol(t *testing.T) {
// this test simply verifies that we accept all enum values specified in our proto
// in order to avoid validator drift.
for name, value := range pbcatalog.Protocol_value {
t.Run(name, func(t *testing.T) {
require.NoError(t, validateProtocol(pbcatalog.Protocol(value)))
})
}
}

func TestValidateHealth(t *testing.T) {
// this test simply verifies that we accept all enum values specified in our proto
// in order to avoid validator drift.
for name, value := range pbcatalog.Health_value {
t.Run(name, func(t *testing.T) {
require.NoError(t, validateHealth(pbcatalog.Health(value)))
})
}
}

func TestValidateWorkloadAddress(t *testing.T) {
type testCase struct {
addr *pbcatalog.WorkloadAddress
Expand Down
7 changes: 6 additions & 1 deletion website/content/docs/enterprise/admin-partitions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ Only resources in the `default` admin partition will be replicated to secondary

### DNS Queries

Client agents will be configured to operate within a specific admin partition. The DNS interface will only return results for the admin partition within the scope of the client.
When queried, the DNS interface returns results for a single admin partition.
The query may explicitly specify the admin partition to use in the lookup.
If you do not specify an admin partition in the query,
the lookup uses the admin partition of the Consul agent that received the query.
Server agents always exist within the `default` admin partition.
Client agents are configured to operate within a specific admin partition.

### Service Mesh Configurations

Expand Down

0 comments on commit ed8559c

Please sign in to comment.