Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let azurerm_storage_share_file re-create deleted files #13269

Merged
merged 3 commits into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions internal/services/storage/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ import (
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/containers"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/datalakestore/filesystems"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/datalakestore/paths"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/file/directories"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/file/files"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/file/shares"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/queue/queues"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/entities"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/table/tables"
"github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/directories"
"github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/files"
"github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares"
)

type Client struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/services/storage/migration/share.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/file/shares"
"github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares"
)

var _ pluginsdk.StateUpgrade = ShareV0ToV1{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"

"github.com/hashicorp/terraform-provider-azurerm/internal/resourceid"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/file/shares"
"github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares"
)

// TODO: tests for this
Expand Down
2 changes: 1 addition & 1 deletion internal/services/storage/shim/shares.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package shim
import (
"context"

"github.com/tombuildsstuff/giovanni/storage/2019-12-12/file/shares"
"github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares"
)

type StorageShareWrapper interface {
Expand Down
2 changes: 1 addition & 1 deletion internal/services/storage/shim/shares_data_plane.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/utils"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/file/shares"
"github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares"
)

type DataPlaneStorageShareWrapper struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
"github.com/hashicorp/terraform-provider-azurerm/internal/timeouts"
"github.com/hashicorp/terraform-provider-azurerm/utils"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/file/directories"
"github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/directories"
)

func resourceStorageShareDirectory() *pluginsdk.Resource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/utils"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/file/directories"
"github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/directories"
)

type StorageShareDirectoryResource struct{}
Expand Down
6 changes: 4 additions & 2 deletions internal/services/storage/storage_share_file_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
"github.com/hashicorp/terraform-provider-azurerm/internal/timeouts"
"github.com/hashicorp/terraform-provider-azurerm/utils"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/file/files"
"github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/files"
)

func resourceStorageShareFile() *pluginsdk.Resource {
Expand Down Expand Up @@ -287,7 +287,9 @@ func resourceStorageShareFileRead(d *pluginsdk.ResourceData, meta interface{}) e

props, err := client.GetProperties(ctx, id.AccountName, id.ShareName, id.DirectoryName, id.FileName)
if err != nil {
return fmt.Errorf("retrieving Storage Share %q (File Share %q / Account %q / Resource Group %q): %s", id.DirectoryName, id.ShareName, id.AccountName, account.ResourceGroup, err)
log.Printf("Retrieving Storage File Share file %q (Directory %q / File Share %q / Account %q / Resource Group %q): %s", id.FileName, id.DirectoryName, id.ShareName, id.AccountName, account.ResourceGroup, err)
heoelri marked this conversation as resolved.
Show resolved Hide resolved
d.SetId("")
return nil
}

d.Set("name", id.FileName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/utils"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/file/files"
"github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/files"
)

type StorageShareFileResource struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/services/storage/storage_share_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk"
"github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation"
"github.com/hashicorp/terraform-provider-azurerm/internal/timeouts"
"github.com/tombuildsstuff/giovanni/storage/2019-12-12/file/shares"
"github.com/tombuildsstuff/giovanni/storage/2020-08-04/file/shares"
)

func resourceStorageShare() *pluginsdk.Resource {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading