Skip to content

Commit ed8559c

Browse files
authored
Merge branch 'main' into NET-1594
2 parents 45c709c + 699aa47 commit ed8559c

3 files changed

Lines changed: 29 additions & 2 deletions

File tree

internal/catalog/internal/types/validators.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,9 @@ func validatePortName(name string) error {
139139

140140
func validateProtocol(protocol pbcatalog.Protocol) error {
141141
switch protocol {
142-
case pbcatalog.Protocol_PROTOCOL_TCP,
142+
case pbcatalog.Protocol_PROTOCOL_UNSPECIFIED,
143+
// means pbcatalog.FailoverMode_FAILOVER_MODE_TCP
144+
pbcatalog.Protocol_PROTOCOL_TCP,
143145
pbcatalog.Protocol_PROTOCOL_HTTP,
144146
pbcatalog.Protocol_PROTOCOL_HTTP2,
145147
pbcatalog.Protocol_PROTOCOL_GRPC,

internal/catalog/internal/types/validators_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,26 @@ func TestValidatePortName(t *testing.T) {
334334
})
335335
}
336336

337+
func TestValidateProtocol(t *testing.T) {
338+
// this test simply verifies that we accept all enum values specified in our proto
339+
// in order to avoid validator drift.
340+
for name, value := range pbcatalog.Protocol_value {
341+
t.Run(name, func(t *testing.T) {
342+
require.NoError(t, validateProtocol(pbcatalog.Protocol(value)))
343+
})
344+
}
345+
}
346+
347+
func TestValidateHealth(t *testing.T) {
348+
// this test simply verifies that we accept all enum values specified in our proto
349+
// in order to avoid validator drift.
350+
for name, value := range pbcatalog.Health_value {
351+
t.Run(name, func(t *testing.T) {
352+
require.NoError(t, validateHealth(pbcatalog.Health(value)))
353+
})
354+
}
355+
}
356+
337357
func TestValidateWorkloadAddress(t *testing.T) {
338358
type testCase struct {
339359
addr *pbcatalog.WorkloadAddress

website/content/docs/enterprise/admin-partitions.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ Only resources in the `default` admin partition will be replicated to secondary
5353

5454
### DNS Queries
5555

56-
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.
56+
When queried, the DNS interface returns results for a single admin partition.
57+
The query may explicitly specify the admin partition to use in the lookup.
58+
If you do not specify an admin partition in the query,
59+
the lookup uses the admin partition of the Consul agent that received the query.
60+
Server agents always exist within the `default` admin partition.
61+
Client agents are configured to operate within a specific admin partition.
5762

5863
### Service Mesh Configurations
5964

0 commit comments

Comments
 (0)