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

State migration for storage account resource #13607

Merged
merged 8 commits into from
Nov 17, 2021

Conversation

koikonom
Copy link
Contributor

@koikonom koikonom commented Oct 4, 2021

In 3.0 we're renaming allow_blob_public_access to
allow_nested_items_to_be_public.

This PR adds a state migration to support this change that only takes
place when we're actually running on 3.0 or the user has opted-in.

Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor comments but this otherwise LGTM 👍

internal/services/storage/storage_account_resource.go Outdated Show resolved Hide resolved
internal/services/storage/storage_account_resource.go Outdated Show resolved Hide resolved
internal/services/storage/storage_account_resource_test.go Outdated Show resolved Hide resolved
internal/services/storage/storage_account_resource_test.go Outdated Show resolved Hide resolved
internal/services/storage/storage_account_resource_test.go Outdated Show resolved Hide resolved
@koikonom koikonom added this to the v2.80.0 milestone Oct 5, 2021
}
schemaVersion := 2

if features.ThreePointOhBetaResources() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tombuildsstuff I'm assuming you did not leave this out on purpose?

@katbyte katbyte modified the milestones: v2.80.0, v2.81.0, v2.82.0 Oct 8, 2021
Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @koikonom

Thanks for pushing those changes - I've left a couple of comments inline but this otherwise LGTM 👍

Thanks!

internal/services/storage/migration/account.go Outdated Show resolved Hide resolved
internal/services/storage/storage_account_resource_test.go Outdated Show resolved Hide resolved
@katbyte katbyte modified the milestones: v2.82.0, v2.83.0 Oct 21, 2021
@github-actions github-actions bot added size/XL and removed size/M labels Oct 22, 2021
@hashicorp hashicorp deleted a comment from github-actions bot Oct 25, 2021
@katbyte katbyte modified the milestones: v2.83.0, v2.84.0 Oct 29, 2021
@katbyte katbyte modified the milestones: v2.84.0, v2.85.0, v2.86.0 Nov 5, 2021
Copy link
Member

@tombuildsstuff tombuildsstuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey @koikonom

Thanks for pushing those changes - apologies for the delayed re-review here.

Taking a look through if we can strip out the validation functions and expand the common schema (since State Migrations are a point-in-time reference, so these shouldn't change over time which common schema may) then this should otherwise be good to go, I've tried to call all of those out so 🤞 most of those can be fixed with Github

Thanks!

internal/services/storage/migration/account.go Outdated Show resolved Hide resolved
internal/services/storage/migration/account.go Outdated Show resolved Hide resolved
internal/services/storage/migration/account.go Outdated Show resolved Hide resolved
internal/services/storage/migration/account.go Outdated Show resolved Hide resolved
internal/services/storage/migration/account.go Outdated Show resolved Hide resolved
internal/services/storage/migration/account.go Outdated Show resolved Hide resolved
internal/services/storage/migration/account.go Outdated Show resolved Hide resolved
internal/services/storage/migration/account.go Outdated Show resolved Hide resolved
internal/services/storage/migration/account.go Outdated Show resolved Hide resolved
internal/services/storage/migration/account.go Outdated Show resolved Hide resolved
@koikonom
Copy link
Contributor Author

Rebased on top of latest main

Kyriakos Oikonomakos and others added 7 commits November 17, 2021 16:03
In 3.0 we're renaming `allow_blob_public_access` to
`allow_nested_items_to_be_public`.

This PR adds a state migration to support this change that only takes
place when we're actually running on 3.0 or the user has opted-in.
We need to call schemaStorageAccountCorsRule from package other than
storage, so we're moving it on its own package that can be imported from
two places.
Remove validation and default settings from state migration schema

Co-authored-by: Tom Harvey <tombuildsstuff@users.noreply.github.com>
@koikonom koikonom force-pushed the storage_resource_statemigration branch from 05de20b to 2fc5e36 Compare November 17, 2021 16:20
@koikonom koikonom force-pushed the storage_resource_statemigration branch from 2fc5e36 to 78d0957 Compare November 17, 2021 17:58
@koikonom koikonom merged commit eba9284 into main Nov 17, 2021
@koikonom koikonom deleted the storage_resource_statemigration branch November 17, 2021 18:35
koikonom pushed a commit that referenced this pull request Nov 17, 2021
@github-actions
Copy link

This functionality has been released in v2.86.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants