Skip to content

Commit

Permalink
Merge pull request #24550 from hashicorp/auto-pandora-pr/4d4acfc68
Browse files Browse the repository at this point in the history
Auto PR: Regenerating based on (76bf3db)
  • Loading branch information
tombuildsstuff authored Jan 18, 2024
2 parents c770d07 + 76bf3db commit 7020049
Showing 1 changed file with 0 additions and 61 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,50 +47,6 @@ func TestAccKubernetesClusterTrustedAccessRoleBinding_requiresImport(t *testing.
data.RequiresImportErrorStep(r.requiresImport),
})
}

func TestAccKubernetesClusterTrustedAccessRoleBinding_complete(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster_trusted_access_role_binding", "test")
r := KubernetesClusterTrustedAccessRoleBindingTestResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.complete(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
})
}

func TestAccKubernetesClusterTrustedAccessRoleBinding_update(t *testing.T) {
data := acceptance.BuildTestData(t, "azurerm_kubernetes_cluster_trusted_access_role_binding", "test")
r := KubernetesClusterTrustedAccessRoleBindingTestResource{}

data.ResourceTest(t, r, []acceptance.TestStep{
{
Config: r.basic(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.complete(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
{
Config: r.basic(data),
Check: acceptance.ComposeTestCheckFunc(
check.That(data.ResourceName).ExistsInAzure(r),
),
},
data.ImportStep(),
})
}
func (r KubernetesClusterTrustedAccessRoleBindingTestResource) Exists(ctx context.Context, clients *clients.Client, state *pluginsdk.InstanceState) (*bool, error) {
id, err := trustedaccess.ParseTrustedAccessRoleBindingID(state.ID)
if err != nil {
Expand Down Expand Up @@ -134,23 +90,6 @@ resource "azurerm_kubernetes_cluster_trusted_access_role_binding" "import" {
`, r.basic(data))
}

func (r KubernetesClusterTrustedAccessRoleBindingTestResource) complete(data acceptance.TestData) string {
return fmt.Sprintf(`
%s
provider "azurerm" {
features {}
}
resource "azurerm_kubernetes_cluster_trusted_access_role_binding" "test" {
kubernetes_cluster_id = azurerm_kubernetes_cluster.test.id
name = "acctestkctarb-${var.random_string}"
roles = ["Microsoft.MachineLearningServices/workspaces/mlworkload", "Microsoft.MachineLearningServices/workspaces/inference-v1"]
source_resource_id = azurerm_machine_learning_workspace.test.id
}
`, r.template(data))
}

func (r KubernetesClusterTrustedAccessRoleBindingTestResource) template(data acceptance.TestData) string {
return fmt.Sprintf(`
variable "primary_location" {
Expand Down

0 comments on commit 7020049

Please sign in to comment.