Skip to content

Commit

Permalink
Update kubernetes_fleet_manager_resource_test.go
Browse files Browse the repository at this point in the history
  • Loading branch information
hqhqhqhqhqhqhqhqhqhqhq committed Dec 23, 2024
1 parent 7f29507 commit 0f9e2f0
Showing 1 changed file with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,27 @@ func TestAccKubernetesFleetManager_complete(t *testing.T) {
})
}

func TestAccKubernetesFleetManager_update(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_kubernetes_fleet_manager", "test")
r := KubernetesFleetManagerTestResource{}
data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.complete(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.update(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
})
}

func (r KubernetesFleetManagerTestResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) {
id, err := fleets.ParseFleetID(state.ID)
if err != nil {
Expand Down Expand Up @@ -125,3 +146,21 @@ resource "azurerm_kubernetes_fleet_manager" "test" {
}
`, r.template(data), data.RandomString)
}

func (r KubernetesFleetManagerTestResource) update(data acceptance.TestData) string {
return fmt.Sprintf(`
%s
resource "azurerm_kubernetes_fleet_manager" "test" {
name = "acctestkfm-%[2]s"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
hub_profile {
dns_prefix = "acctestkfm-%[2]s"
}
tags = {
new_environment = "terraform-acctests-updated"
}
}
`, r.template(data), data.RandomString)
}

0 comments on commit 0f9e2f0

Please sign in to comment.