terraform-provider-azurerm icon indicating copy to clipboard operation
terraform-provider-azurerm copied to clipboard

Modified ADLS2 ACLs parsing to properly treat default entries.

Open dkuzmenok opened this issue 2 years ago • 0 comments

Description

By default, API is adding default rules for ACLs. You can overwrite them, modify, but they are always being added to a specific filesystem path.

That created a never-ending apply/plan cycle, when terraform expects to have specific list of ACLs and API adjusts it from their side.

Changes

The change is checking whether terraform wants to modify default ACLs, and if no - hides them from the list.

That makes sure we don't mix auto-added ACLs with the ones we do not expect to see. That is applied only to non-custom ACL entries.

Issues

Resolves #10814. Resolves #11435.

Tests

# go test -v -timeout 3000s -run ^TestAccStorageDataLakeGen2 github.com/hashicorp/terraform-provider-azurerm/internal/services/storage/
=== RUN   TestAccStorageDataLakeGen2FileSystem_basic
=== PAUSE TestAccStorageDataLakeGen2FileSystem_basic
=== RUN   TestAccStorageDataLakeGen2FileSystem_requiresImport
=== PAUSE TestAccStorageDataLakeGen2FileSystem_requiresImport
=== RUN   TestAccStorageDataLakeGen2FileSystem_withDefaultACL
=== PAUSE TestAccStorageDataLakeGen2FileSystem_withDefaultACL
=== RUN   TestAccStorageDataLakeGen2FileSystem_UpdateDefaultACL
=== PAUSE TestAccStorageDataLakeGen2FileSystem_UpdateDefaultACL
=== RUN   TestAccStorageDataLakeGen2FileSystem_properties
=== PAUSE TestAccStorageDataLakeGen2FileSystem_properties
=== RUN   TestAccStorageDataLakeGen2FileSystem_handlesStorageAccountDeletion
=== PAUSE TestAccStorageDataLakeGen2FileSystem_handlesStorageAccountDeletion
=== RUN   TestAccStorageDataLakeGen2FileSystem_withOwnerGroup
=== PAUSE TestAccStorageDataLakeGen2FileSystem_withOwnerGroup
=== RUN   TestAccStorageDataLakeGen2FileSystem_withSuperUsers
=== PAUSE TestAccStorageDataLakeGen2FileSystem_withSuperUsers
=== RUN   TestAccStorageDataLakeGen2Path_basic
=== PAUSE TestAccStorageDataLakeGen2Path_basic
=== RUN   TestAccStorageDataLakeGen2Path_requiresImport
=== PAUSE TestAccStorageDataLakeGen2Path_requiresImport
=== RUN   TestAccStorageDataLakeGen2Path_withSimpleACLAndUpdate
=== PAUSE TestAccStorageDataLakeGen2Path_withSimpleACLAndUpdate
=== RUN   TestAccStorageDataLakeGen2Path_withSimpleACL
=== PAUSE TestAccStorageDataLakeGen2Path_withSimpleACL
=== RUN   TestAccStorageDataLakeGen2Path_withACLWithSpecificUserAndDefaults
=== PAUSE TestAccStorageDataLakeGen2Path_withACLWithSpecificUserAndDefaults
=== RUN   TestAccStorageDataLakeGen2Path_withOwner
=== PAUSE TestAccStorageDataLakeGen2Path_withOwner
=== RUN   TestAccStorageDataLakeGen2Path_withSuperUsers
=== PAUSE TestAccStorageDataLakeGen2Path_withSuperUsers
=== CONT  TestAccStorageDataLakeGen2FileSystem_basic
=== CONT  TestAccStorageDataLakeGen2Path_basic
=== CONT  TestAccStorageDataLakeGen2Path_withACLWithSpecificUserAndDefaults
=== CONT  TestAccStorageDataLakeGen2FileSystem_properties
--- PASS: TestAccStorageDataLakeGen2FileSystem_basic (127.50s)
=== CONT  TestAccStorageDataLakeGen2Path_withSuperUsers
--- PASS: TestAccStorageDataLakeGen2Path_basic (149.22s)
=== CONT  TestAccStorageDataLakeGen2Path_withOwner
--- PASS: TestAccStorageDataLakeGen2Path_withACLWithSpecificUserAndDefaults (162.82s)
=== CONT  TestAccStorageDataLakeGen2FileSystem_withDefaultACL
--- PASS: TestAccStorageDataLakeGen2FileSystem_properties (249.68s)
=== CONT  TestAccStorageDataLakeGen2FileSystem_UpdateDefaultACL
--- PASS: TestAccStorageDataLakeGen2Path_withSuperUsers (170.32s)
=== CONT  TestAccStorageDataLakeGen2FileSystem_requiresImport
--- PASS: TestAccStorageDataLakeGen2Path_withOwner (285.87s)
=== CONT  TestAccStorageDataLakeGen2Path_withSimpleACLAndUpdate
--- PASS: TestAccStorageDataLakeGen2FileSystem_withDefaultACL (274.82s)
=== CONT  TestAccStorageDataLakeGen2Path_withSimpleACL
--- PASS: TestAccStorageDataLakeGen2FileSystem_requiresImport (183.59s)
=== CONT  TestAccStorageDataLakeGen2FileSystem_withOwnerGroup
--- PASS: TestAccStorageDataLakeGen2FileSystem_UpdateDefaultACL (282.75s)
=== CONT  TestAccStorageDataLakeGen2FileSystem_withSuperUsers
--- PASS: TestAccStorageDataLakeGen2Path_withSimpleACL (142.06s)
=== CONT  TestAccStorageDataLakeGen2Path_requiresImport
--- PASS: TestAccStorageDataLakeGen2FileSystem_withOwnerGroup (107.48s)
=== CONT  TestAccStorageDataLakeGen2FileSystem_handlesStorageAccountDeletion
--- PASS: TestAccStorageDataLakeGen2Path_withSimpleACLAndUpdate (274.19s)
--- PASS: TestAccStorageDataLakeGen2FileSystem_withSuperUsers (178.01s)
--- PASS: TestAccStorageDataLakeGen2FileSystem_handlesStorageAccountDeletion (172.19s)
--- PASS: TestAccStorageDataLakeGen2Path_requiresImport (217.87s)
PASS
ok      github.com/hashicorp/terraform-provider-azurerm/internal/services/storage       797.602s
#

dkuzmenok avatar Sep 22 '22 13:09 dkuzmenok