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

Support Upload creation_type with uploadSizeBytes #19458

Merged
merged 5 commits into from Nov 30, 2022

Conversation

harshavmb
Copy link
Contributor

Support Upload as one of the create_option. To be used in combination with upload_size_bytes.
Helpful to upload VHD disks from On-Prem <-> Azure, Azure <-> Azure etc.,

Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

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

Hey @harshavmb. This looks mostly good but there are a few big things that we need to fix before merging.

The test is failing with:

=== CONT  TestAccManagedDisk_upload
testcase.go:110: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
(map[string]string) {
}
(map[string]string) (len=1) {
(string) (len=17) "upload_size_bytes": (string) (len=11) "21475885568"
}
--- FAIL: TestAccManagedDisk_upload (244.56s)

This is because we aren't setting it in resourceManagedDiskRead so you'll want to add that too

@harshavmb
Copy link
Contributor Author

Hey @harshavmb. This looks mostly good but there are a few big things that we need to fix before merging.

The test is failing with:

=== CONT  TestAccManagedDisk_upload
testcase.go:110: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
(map[string]string) {
}
(map[string]string) (len=1) {
(string) (len=17) "upload_size_bytes": (string) (len=11) "21475885568"
}
--- FAIL: TestAccManagedDisk_upload (244.56s)

This is because we aren't setting it in resourceManagedDiskRead so you'll want to add that too

Hey @harshavmb. This looks mostly good but there are a few big things that we need to fix before merging.

The test is failing with:

=== CONT  TestAccManagedDisk_upload
testcase.go:110: ImportStateVerify attributes not equivalent. Difference is shown below. Top is actual, bottom is expected.
(map[string]string) {
}
(map[string]string) (len=1) {
(string) (len=17) "upload_size_bytes": (string) (len=11) "21475885568"
}
--- FAIL: TestAccManagedDisk_upload (244.56s)

This is because we aren't setting it in resourceManagedDiskRead so you'll want to add that too

Thanks @mbfrahry for your review. Indeed, I missed to update resourceManagedDiskRead function.
Regarding resourceManagedDiskUpdate, I don't think updates are supported as I see no support in SDK for UploadSizeBytes in DiskUpdate struct here.

So, to avoid that what I've done is whenever, upload_size_bytes is changed, we force to create a new disk with the requested size. I think this makes sense as the disk is in unattached state & doesn't have any data to lose. So, could be created as many times as we can to copy the data.

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Test looks good now @harshavmb, just some remaining suggestions on the docs then this should be good to go!

website/docs/r/managed_disk.html.markdown Outdated Show resolved Hide resolved
website/docs/r/managed_disk.html.markdown Outdated Show resolved Hide resolved
@harshavmb
Copy link
Contributor Author

Test looks good now @harshavmb, just some remaining suggestions on the docs then this should be good to go!

hi @stephybun ,

Committed changes as per the review.

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Thanks @harshavmb LGTM 👍

@stephybun stephybun merged commit 25c7b98 into hashicorp:main Nov 30, 2022
@github-actions github-actions bot added this to the v3.34.0 milestone Nov 30, 2022
stephybun added a commit that referenced this pull request Nov 30, 2022
@github-actions
Copy link

github-actions bot commented Dec 2, 2022

This functionality has been released in v3.34.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

github-actions bot commented Jan 2, 2023

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 Jan 2, 2023
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