2023-09-19 22:14:15 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
|
|
|
|
package resource
|
|
|
|
|
|
|
|
func peerNameV2ToV1(peer string) string {
|
|
|
|
// The name of the local/default peer is different between v1 and v2.
|
2024-01-29 20:08:31 +00:00
|
|
|
if peer == DefaultPeerName {
|
2023-09-19 22:14:15 +00:00
|
|
|
return ""
|
|
|
|
}
|
|
|
|
return peer
|
|
|
|
}
|
|
|
|
|
|
|
|
func peerNameV1ToV2(peer string) string {
|
|
|
|
// The name of the local/default peer is different between v1 and v2.
|
|
|
|
if peer == "" {
|
2024-01-29 20:08:31 +00:00
|
|
|
return DefaultPeerName
|
2023-09-19 22:14:15 +00:00
|
|
|
}
|
|
|
|
return peer
|
|
|
|
}
|