-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: r/vsphere_file
provider crash
#1866
Conversation
…rp#1779 Update resource_vsphere_file.createDirectory method to check whether the provided file path has any parent folder(s). If there are no folders to be created we return early without invoking FileManager.MakeDirectory. This fixes the “slice bounds out of range” runtime error which was crashing the provider. Fix the resource_vsphere_file_test acceptance tests as they were failing due to incorrect test vmdk files. Also, adding new TestAccResourceVSphereFile_uploadWithCreateDirectories test to cover the r/vsphere_file.create_directories configuration field.
r/vsphere_file
causes crash with incorrect configuration #1779r/vsphere_file
causes crash with incorrect configuration
r/vsphere_file
causes crash with incorrect configurationr/vsphere_file
causes provider crash
r/vsphere_file
causes provider crashr/vsphere_file
provider crash
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, @stoyan-hristov.
Reviewed, successfully tested, and approved. 🚀
@appilon - contingent on your review of the update and additonal acceptance 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.
LGTM
This functionality has been released in v2.4.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! |
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 issues. 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. |
Description
resource_vsphere_file.createDirectory
method to check whether the provided file path has any parent folder(s). If there are no folders to be created we return early without invokingFileManager.MakeDirectory
. This fixes the “slice bounds out of range” runtime error which was crashing the provider.resource_vsphere_file_test
acceptance tests as they were failing due to incorrect test vmdk files.r/vsphere_file.create_directories
configuration argument.Testing done:
Performed terraform apply using the following configuration:
And verified that the file was uploaded correctly without any runtime errors.
Acceptance tests
Added
TestAccResourceVSphereFile_uploadWithCreateDirectories
Output from acceptance testing
Release Note
Release note for CHANGELOG:
Bug Fix:
r/vsphere_file
: Fixes a provider crash by updating thecreateDirectory
method to check if the provided file path has any parent folder(s). If no folders need to be createdFileManager.MakeDirectory
is not invoked.References
Closes #1779