Skip to content

Commit

Permalink
spec.0.cloud.0.azure can be empty after import, must not force new later
Browse files Browse the repository at this point in the history
  • Loading branch information
furkhat committed Aug 18, 2021
1 parent e12def3 commit 6be5191
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DOMAIN=syseleven.de
NAMESPACE=syseleven
PKG_NAME=metakube
BINARY=terraform-provider-${PKG_NAME}
VERSION=0.4.0
VERSION=0.4.1
PLATFORM=darwin_amd64
SWEEP_DIR?=./metakube
SWEEP?=all
Expand Down
2 changes: 1 addition & 1 deletion metakube/resource_metakube_cluster_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func metakubeResourceClusterSpecFields() map[string]*schema.Schema {
"azure": {
Type: schema.TypeList,
Optional: true,
ForceNew: true,
MaxItems: 1,
Description: "Azire cluster specification",
Elem: &schema.Resource{
Schema: metakubeResourceClusterAzureSpecFields(),
Expand Down
37 changes: 37 additions & 0 deletions metakube/resource_metakube_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,26 @@ func TestAccMetakubeCluster_Azure_Basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "spec.0.cloud.0.azure.0.subscription_id", subsID),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{
"spec.0.cloud.0.azure.#",
"spec.0.cloud.0.azure.0.%",
"spec.0.cloud.0.azure.0.availability_set",
"spec.0.cloud.0.azure.0.openstack_billing_tenant",
"spec.0.cloud.0.azure.0.resource_group",
"spec.0.cloud.0.azure.0.route_table",
"spec.0.cloud.0.azure.0.security_group",
"spec.0.cloud.0.azure.0.subnet",
"spec.0.cloud.0.azure.0.vnet",
"spec.0.cloud.0.azure.0.client_id",
"spec.0.cloud.0.azure.0.client_secret",
"spec.0.cloud.0.azure.0.tenant_id",
"spec.0.cloud.0.azure.0.subscription_id",
},
},
},
})
}
Expand Down Expand Up @@ -661,6 +681,23 @@ func TestAccMetakubeCluster_AWS_Basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "spec.0.cloud.0.aws.#", "1"),
),
},
{
ResourceName: resourceName,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{
"spec.0.cloud.0.aws.#",
"spec.0.cloud.0.aws.0.%",
"spec.0.cloud.0.aws.0.instance_profile_name",
"spec.0.cloud.0.aws.0.role_arn",
"spec.0.cloud.0.aws.0.route_table_id",
"spec.0.cloud.0.aws.0.access_key_id",
"spec.0.cloud.0.aws.0.security_group_id",
"spec.0.cloud.0.aws.0.secret_access_key",
"spec.0.cloud.0.aws.0.vpc_id",
"spec.0.cloud.0.aws.0.openstack_billing_tenant",
},
},
},
})
}
Expand Down

0 comments on commit 6be5191

Please sign in to comment.