mirror of https://github.com/hashicorp/consul
resource: default peername to local in list endpoints (#19340)
parent
ee2f046383
commit
96606d114c
|
@ -205,6 +205,11 @@ func validateWildcardTenancy(tenancy *pbresource.Tenancy, namePrefix string) err
|
||||||
return status.Errorf(codes.InvalidArgument, "name_prefix invalid: must be lowercase alphanumeric, got: %v", namePrefix)
|
return status.Errorf(codes.InvalidArgument, "name_prefix invalid: must be lowercase alphanumeric, got: %v", namePrefix)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(spatel): NET-5475 - Remove as part of peer_name moving to PeerTenancy
|
||||||
|
if tenancy.PeerName == "" {
|
||||||
|
tenancy.PeerName = resource.DefaultPeerName
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,6 +157,15 @@ func wildcardTenancyCases() map[string]struct {
|
||||||
PeerName: "local",
|
PeerName: "local",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// TODO(spatel): NET-5475 - Remove as part of peer_name moving to PeerTenancy
|
||||||
|
"namespaced type with empty peername": {
|
||||||
|
typ: demo.TypeV2Artist,
|
||||||
|
tenancy: &pbresource.Tenancy{
|
||||||
|
Partition: resource.DefaultPartitionName,
|
||||||
|
Namespace: resource.DefaultNamespaceName,
|
||||||
|
PeerName: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
"namespaced type with empty partition and namespace": {
|
"namespaced type with empty partition and namespace": {
|
||||||
typ: demo.TypeV2Artist,
|
typ: demo.TypeV2Artist,
|
||||||
tenancy: &pbresource.Tenancy{
|
tenancy: &pbresource.Tenancy{
|
||||||
|
|
Loading…
Reference in New Issue