Skip to content

Commit

Permalink
r/private_endpoint: updating the resource provider name
Browse files Browse the repository at this point in the history
This should be Microsoft.Cache rather than Microsoft.Redis, which differs from other RP's
caught by @wiebeck here #20418 (comment)
  • Loading branch information
tombuildsstuff committed Feb 16, 2023
1 parent d5f4a07 commit db3fd15
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/services/network/private_endpoint_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,12 @@ func validatePrivateEndpointSettings(d *pluginsdk.ResourceData) error {

// normalize the PrivateConnectionId due to the casing change at service side
func normalizePrivateConnectionId(privateConnectionId string) string {
// intentionally including the extra segment to handle Redis vs Redis Enterprise (which is within the same RP)
if strings.Contains(strings.ToLower(privateConnectionId), "microsoft.cache/redis/") {
if cacheId, err := redis.ParseRediIDInsensitively(privateConnectionId); err == nil {
privateConnectionId = cacheId.ID()
}
}
if strings.Contains(strings.ToLower(privateConnectionId), "microsoft.dbforpostgresql") {
if serverId, err := postgresqlServers.ParseServerIDInsensitively(privateConnectionId); err == nil {
privateConnectionId = serverId.ID()
Expand All @@ -1147,11 +1153,6 @@ func normalizePrivateConnectionId(privateConnectionId string) string {
privateConnectionId = serverId.ID()
}
}
if strings.Contains(strings.ToLower(privateConnectionId), "microsoft.redis") {
if cacheId, err := redis.ParseRediIDInsensitively(privateConnectionId); err == nil {
privateConnectionId = cacheId.ID()
}
}
if strings.Contains(strings.ToLower(privateConnectionId), "microsoft.signalrservice") {
if serviceId, err := signalr.ParseSignalRIDInsensitively(privateConnectionId); err == nil {
privateConnectionId = serviceId.ID()
Expand Down

0 comments on commit db3fd15

Please sign in to comment.