Skip to content

Commit

Permalink
storage: fixing the build
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Mar 15, 2024
1 parent bc18526 commit 721839d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 5 additions & 1 deletion internal/services/storage/storage_container_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ func dataSourceStorageContainerRead(d *pluginsdk.ResourceData, meta interface{})
d.Set("has_immutability_policy", props.HasImmutabilityPolicy)
d.Set("has_legal_hold", props.HasLegalHold)

resourceManagerId := commonids.NewStorageContainerID(storageClient.SubscriptionId, account.ResourceGroup, accountName, containerName)
storageAccountId, err := commonids.ParseStorageAccountIDInsensitively(account.ID)
if err != nil {
return err
}
resourceManagerId := commonids.NewStorageContainerID(storageAccountId.SubscriptionId, storageAccountId.ResourceGroupName, storageAccountId.StorageAccountName, containerName)
d.Set("resource_manager_id", resourceManagerId.ID())

return nil
Expand Down
7 changes: 6 additions & 1 deletion internal/services/storage/storage_share_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package storage

import (
"fmt"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"

Check failure on line 8 in internal/services/storage/storage_share_data_source.go

View workflow job for this annotation

GitHub Actions / golint

File is not `goimports`-ed (goimports)
"time"

"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
Expand Down Expand Up @@ -139,7 +140,11 @@ func dataSourceStorageShareRead(d *pluginsdk.ResourceData, meta interface{}) err
return fmt.Errorf("setting `metadata`: %v", err)
}

resourceManagerId := parse.NewStorageShareResourceManagerID(storageClient.SubscriptionId, account.ResourceGroup, accountName, "default", shareName)
storageAccountId, err := commonids.ParseStorageAccountIDInsensitively(account.ID)
if err != nil {
return err
}
resourceManagerId := parse.NewStorageShareResourceManagerID(storageAccountId.SubscriptionId, storageAccountId.ResourceGroupName, storageAccountId.StorageAccountName, "default", shareName)
d.Set("resource_manager_id", resourceManagerId.ID())

return nil
Expand Down
7 changes: 6 additions & 1 deletion internal/services/storage/storage_share_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package storage

import (
"fmt"
"github.com/hashicorp/go-azure-helpers/resourcemanager/commonids"

Check failure on line 8 in internal/services/storage/storage_share_resource.go

View workflow job for this annotation

GitHub Actions / golint

File is not `goimports`-ed (goimports)
"log"
"time"

Expand Down Expand Up @@ -285,7 +286,11 @@ func resourceStorageShareRead(d *pluginsdk.ResourceData, meta interface{}) error
return fmt.Errorf("flattening `metadata`: %+v", err)
}

resourceManagerId := parse.NewStorageShareResourceManagerID(storageClient.SubscriptionId, account.ResourceGroup, id.AccountId.AccountName, "default", id.ShareName)
storageAccountId, err := commonids.ParseStorageAccountIDInsensitively(account.ID)
if err != nil {
return err
}
resourceManagerId := parse.NewStorageShareResourceManagerID(storageAccountId.SubscriptionId, storageAccountId.ResourceGroupName, storageAccountId.StorageAccountName, "default", id.ShareName)
d.Set("resource_manager_id", resourceManagerId.ID())

return nil
Expand Down

0 comments on commit 721839d

Please sign in to comment.