-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Netapp volumes: Add restoreParameters #9918
Conversation
- added parameters state and state_details. Needs discussion if they are to be included. Currently they are deactivated - added restore_parameters. - added test for restore_parameters.source_snapshot - adding a test for restore_parameters.sourceBackup required currently non-existing backup resoruce and would have long runtime - renamed the example file to follow format of other peer resources
Hello! I am a robot. It looks like you are a: Community Contributor @shuyama1, a repository maintainer, has been assigned to review your changes. If you have not received review feedback within 2 business days, please leave a comment on this PR asking them to take a look. You can help make sure that review is quick by doing a self-review and by running impacted tests locally. |
@shuyama1 Please take note. In a prior review you said we shouldn't add state, stateDetails and creationTime. Still true? backupConfig part is commented out. I would prefer if we can handle it in a follow-on PR/merge. |
We used to find these output fields are typically not useful to Terraform users, but we start to see users request fields like creationTime recently, so feel free to add fields that are supported by the API and you think may be useful to users. (Plus, I've updated changelog according to https://googlecloudplatform.github.io/magic-modules/contribute/release-notes/#write-release-notes) |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 4 files changed, 194 insertions(+), 34 deletions(-)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_netapp_volume" "primary" {
restore_parameters {
source_backup = # value needed
}
}
|
Tests analyticsTotal tests: Click here to see the affected service packages
Action takenFound 2 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccNetappVolume_netappVolumeBasicExample|TestAccNetappVolume_netappVolumeBasicExample_update |
Rerun these tests in REPLAYING mode to catch issues
|
- restore_parameters.0.source_backup | ||
immutable: true | ||
- !ruby/object:Api::Type::String | ||
name: 'sourceBackup' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we set this in a test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet. We don't have a backup resource yet to create backups to restore from.
Backup is a bit complex. I have a draft for backup, which I didn't PR yet, since it needs more work. CRUD for backup isn't that complex itself, but the interaction between vault, backups and volumes is a bit complex. I want to make backupConfig parameter of volume work too first (making good progress, may need to update this PR to include it today or tomorrow). Also note that backup tests will extend test runtime for many minutes.
Back to this one: We currently cannot test it. I can remove it for now, but voted to keep it in, since the TF interaction is pretty simple. Specify an valid URN for a backup. There isn't too much which can go wrong in TF here, right?
What is your take: Omit it for now, or leave it in with the small risk that it might fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply.
Can you test it locally, like create a backup resource not via Terraform and use that for sourceBackup
for volume creation via Terraform. I think we can keep it and local testing should be sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it and it works as expected. They only fact worth mentioning: The API triggers the restore. The LRO returns after the restore job is set up. The new volume resource is being created with state==RESTORING, which will eventually (after minutes/hours/days, depending on the amount of data to restore) will transition to state=READY.
This means the restore operation triggered will run asynchronously and the will not wait for it to complete.
- make backup_config parameters "exactly_one_of" - some work on backup_config, but still disabled - added tests for backup_config, but still disabled - made tests more compact by removing resources and fields which did their job earlier but aren't required later anymore.
Tests analyticsTotal tests: Click here to see the affected service packages
Action takenFound 1 affected test(s) by replaying old test recordings. Starting RECORDING based on the most recent commit. Click here to see the affected testsTestAccNetappVolume_netappVolumeBasicExample_update |
Rerun these tests in REPLAYING mode to catch issues
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restoreParameters
implementation looks good mostly. Only some small comments
Would you mind removing backupConfig
related changes from this PR, including commented out implementation code and tests. Let's move it to a separate PR so we can ship this feature first if preferred
mmv1/third_party/terraform/services/netapp/resource_netapp_volume_test.go
Show resolved
Hide resolved
@@ -53,7 +53,7 @@ parameters: | |||
url_param_only: true | |||
examples: | |||
- !ruby/object:Provider::Terraform::Examples | |||
name: 'volume_basic' | |||
name: 'netapp_volume_basic' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason that we want to change this name + handwritten test names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the inner Monk in me. I don't like the fact that the example isn't prefixed with netapp_volume to make clear where it belongs too. Having that prefix makes the content of the example folder more tidy, move the example file closer to other netapp_volume resources in the folder listing and tells anyone looking at the file name to which resource it belongs too.
So basically this is cleanup. Is this causing other problems I don't see?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No big issues. It's just we run integration tests nightly and changing name may lose history of test results. So just want to make sure this change is intended
/gcbrun |
Hi there, I'm the Modular magician. I've detected the following information about your changes: Diff reportYour PR generated some diffs in downstreams - here they are. Terraform GA: Diff ( 4 files changed, 420 insertions(+), 231 deletions(-)) Missing test reportYour PR includes resource fields which are not covered by any test. Resource: resource "google_netapp_volume" "primary" {
restore_parameters {
source_backup = # value needed
}
}
|
Tests analyticsTotal tests: Click here to see the affected service packages
|
@okrause is there any plan for adding |
@imrannayer Yes, but that will be another PR. Waiting for a few dependencies to be resolved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
@@ -53,7 +53,7 @@ parameters: | |||
url_param_only: true | |||
examples: | |||
- !ruby/object:Provider::Terraform::Examples | |||
name: 'volume_basic' | |||
name: 'netapp_volume_basic' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No big issues. It's just we run integration tests nightly and changing name may lose history of test results. So just want to make sure this change is intended
Thank you for the review and merging. |
* Add force delete to delete volumes with nested snapshots * few cleanups * Make virtual field verifies happy * Minor test improvements * Remove ignore_read for deletion_policy * Fix typos in snapRestore comment * Adding missing fields state, StateDetails, backupConfig * BackupConfig is work in progress * Implemented restoreParameters - added parameters state and state_details. Needs discussion if they are to be included. Currently they are deactivated - added restore_parameters. - added test for restore_parameters.source_snapshot - adding a test for restore_parameters.sourceBackup required currently non-existing backup resoruce and would have long runtime - renamed the example file to follow format of other peer resources * More improvements on restore_parameters * Comment cleanups * Remove backupConfig support for now. * Fix small typos * - Adding state, state_details and create_time fields - make backup_config parameters "exactly_one_of" - some work on backup_config, but still disabled - added tests for backup_config, but still disabled - made tests more compact by removing resources and fields which did their job earlier but aren't required later anymore. * convert tabs to spaces in test resource blocks * remove backupConfig. Will PR later
* Add force delete to delete volumes with nested snapshots * few cleanups * Make virtual field verifies happy * Minor test improvements * Remove ignore_read for deletion_policy * Fix typos in snapRestore comment * Adding missing fields state, StateDetails, backupConfig * BackupConfig is work in progress * Implemented restoreParameters - added parameters state and state_details. Needs discussion if they are to be included. Currently they are deactivated - added restore_parameters. - added test for restore_parameters.source_snapshot - adding a test for restore_parameters.sourceBackup required currently non-existing backup resoruce and would have long runtime - renamed the example file to follow format of other peer resources * More improvements on restore_parameters * Comment cleanups * Remove backupConfig support for now. * Fix small typos * - Adding state, state_details and create_time fields - make backup_config parameters "exactly_one_of" - some work on backup_config, but still disabled - added tests for backup_config, but still disabled - made tests more compact by removing resources and fields which did their job earlier but aren't required later anymore. * convert tabs to spaces in test resource blocks * remove backupConfig. Will PR later
* Add force delete to delete volumes with nested snapshots * few cleanups * Make virtual field verifies happy * Minor test improvements * Remove ignore_read for deletion_policy * Fix typos in snapRestore comment * Adding missing fields state, StateDetails, backupConfig * BackupConfig is work in progress * Implemented restoreParameters - added parameters state and state_details. Needs discussion if they are to be included. Currently they are deactivated - added restore_parameters. - added test for restore_parameters.source_snapshot - adding a test for restore_parameters.sourceBackup required currently non-existing backup resoruce and would have long runtime - renamed the example file to follow format of other peer resources * More improvements on restore_parameters * Comment cleanups * Remove backupConfig support for now. * Fix small typos * - Adding state, state_details and create_time fields - make backup_config parameters "exactly_one_of" - some work on backup_config, but still disabled - added tests for backup_config, but still disabled - made tests more compact by removing resources and fields which did their job earlier but aren't required later anymore. * convert tabs to spaces in test resource blocks * remove backupConfig. Will PR later
* Add force delete to delete volumes with nested snapshots * few cleanups * Make virtual field verifies happy * Minor test improvements * Remove ignore_read for deletion_policy * Fix typos in snapRestore comment * Adding missing fields state, StateDetails, backupConfig * BackupConfig is work in progress * Implemented restoreParameters - added parameters state and state_details. Needs discussion if they are to be included. Currently they are deactivated - added restore_parameters. - added test for restore_parameters.source_snapshot - adding a test for restore_parameters.sourceBackup required currently non-existing backup resoruce and would have long runtime - renamed the example file to follow format of other peer resources * More improvements on restore_parameters * Comment cleanups * Remove backupConfig support for now. * Fix small typos * - Adding state, state_details and create_time fields - make backup_config parameters "exactly_one_of" - some work on backup_config, but still disabled - added tests for backup_config, but still disabled - made tests more compact by removing resources and fields which did their job earlier but aren't required later anymore. * convert tabs to spaces in test resource blocks * remove backupConfig. Will PR later
* Add force delete to delete volumes with nested snapshots * few cleanups * Make virtual field verifies happy * Minor test improvements * Remove ignore_read for deletion_policy * Fix typos in snapRestore comment * Adding missing fields state, StateDetails, backupConfig * BackupConfig is work in progress * Implemented restoreParameters - added parameters state and state_details. Needs discussion if they are to be included. Currently they are deactivated - added restore_parameters. - added test for restore_parameters.source_snapshot - adding a test for restore_parameters.sourceBackup required currently non-existing backup resoruce and would have long runtime - renamed the example file to follow format of other peer resources * More improvements on restore_parameters * Comment cleanups * Remove backupConfig support for now. * Fix small typos * - Adding state, state_details and create_time fields - make backup_config parameters "exactly_one_of" - some work on backup_config, but still disabled - added tests for backup_config, but still disabled - made tests more compact by removing resources and fields which did their job earlier but aren't required later anymore. * convert tabs to spaces in test resource blocks * remove backupConfig. Will PR later
* Add force delete to delete volumes with nested snapshots * few cleanups * Make virtual field verifies happy * Minor test improvements * Remove ignore_read for deletion_policy * Fix typos in snapRestore comment * Adding missing fields state, StateDetails, backupConfig * BackupConfig is work in progress * Implemented restoreParameters - added parameters state and state_details. Needs discussion if they are to be included. Currently they are deactivated - added restore_parameters. - added test for restore_parameters.source_snapshot - adding a test for restore_parameters.sourceBackup required currently non-existing backup resoruce and would have long runtime - renamed the example file to follow format of other peer resources * More improvements on restore_parameters * Comment cleanups * Remove backupConfig support for now. * Fix small typos * - Adding state, state_details and create_time fields - make backup_config parameters "exactly_one_of" - some work on backup_config, but still disabled - added tests for backup_config, but still disabled - made tests more compact by removing resources and fields which did their job earlier but aren't required later anymore. * convert tabs to spaces in test resource blocks * remove backupConfig. Will PR later
* Add force delete to delete volumes with nested snapshots * few cleanups * Make virtual field verifies happy * Minor test improvements * Remove ignore_read for deletion_policy * Fix typos in snapRestore comment * Adding missing fields state, StateDetails, backupConfig * BackupConfig is work in progress * Implemented restoreParameters - added parameters state and state_details. Needs discussion if they are to be included. Currently they are deactivated - added restore_parameters. - added test for restore_parameters.source_snapshot - adding a test for restore_parameters.sourceBackup required currently non-existing backup resoruce and would have long runtime - renamed the example file to follow format of other peer resources * More improvements on restore_parameters * Comment cleanups * Remove backupConfig support for now. * Fix small typos * - Adding state, state_details and create_time fields - make backup_config parameters "exactly_one_of" - some work on backup_config, but still disabled - added tests for backup_config, but still disabled - made tests more compact by removing resources and fields which did their job earlier but aren't required later anymore. * convert tabs to spaces in test resource blocks * remove backupConfig. Will PR later
This PR is the next stop on adding functionality to the google_netapp_volume resource. It adds support for restoreParameters which are two features:
It also does some cleanup on comments and file renames for better consistency.
Release Note Template for Downstream PRs (will be copied)