Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

azurerm_container_registry - Avoid unnecessary recreate when georeplication.tags update #24994

Merged
merged 4 commits into from
Mar 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update test
  • Loading branch information
magodo committed Feb 29, 2024
commit fda7022c6ac94d308b6e5a3e6eb753782d723400
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package containers_test
import (
"context"
"fmt"
"slices"
"testing"

"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
Expand Down Expand Up @@ -208,8 +209,11 @@ func TestAccContainerRegistry_geoReplicationLocation(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_container_registry", "test")
r := ContainerRegistryResource{}

secondaryLocation := location.Normalize(data.Locations.Secondary)
ternaryLocation := location.Normalize(data.Locations.Ternary)
locs := []string{location.Normalize(data.Locations.Secondary), location.Normalize(data.Locations.Ternary)}
// Sorting the secondary and ternary locations to ensure the order as is expected by this resource (see its Read() function)
slices.Sort(locs)
secondaryLocation := locs[0]
ternaryLocation := locs[1]

data.ResourceTest(t, r, []acceptance.TestStep{
// creates an ACR with locations
Expand Down
Loading