Skip to content
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

Add attribute to create parent directories when creating a virtual disk #512

Merged

Conversation

luis-silva
Copy link

This PR introduces the attribute to create the parent directories in the datastore when creating a resource_vsphere_virtualdisk. It uses the same logic seen in resource_vsphere_file.go with an extra check to ensure the directory is already created before creating the disk since the 'MakeDirectory' call does not return a task we can wait on.

@luis-silva
Copy link
Author

Sharing the test results:

$ make testacc TESTARGS="-run=TestAccVSphereVirtualDisk"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestAccVSphereVirtualDisk -timeout 240m
?   	github.com/terraform-providers/terraform-provider-vsphere	[no test files]
=== RUN   TestAccVSphereVirtualDisk_basic
--- PASS: TestAccVSphereVirtualDisk_basic (7.40s)
=== RUN   TestAccVSphereVirtualDisk_withParents
--- PASS: TestAccVSphereVirtualDisk_withParents (8.85s)
PASS
ok  	github.com/terraform-providers/terraform-provider-vsphere/vsphere	16.279s
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/clustercomputeresource	[no test files]
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/computeresource	[no test files]
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/customattribute	[no test files]
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/datastore	[no test files]
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/dvportgroup	[no test files]
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/envbrowse	[no test files]
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/folder	[no test files]
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/hostsystem	[no test files]
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/network	[no test files]
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/nsx	[no test files]
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/provider	[no test files]
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/resourcepool	[no test files]
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/storagepod	[no test files]
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/structure	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/viapi	0.027s [no tests to run]
testing: warning: no tests to run
PASS
ok  	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/virtualdisk	0.026s [no tests to run]
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/virtualmachine	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/virtualdevice	0.023s [no tests to run]
?   	github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/vmworkflow	[no test files]

@luis-silva
Copy link
Author

@vancluever I see you have several PRs open and probably know the answer to my question.
Do I need to tag anyone to notify them of this PR since I'm an 'external' contributor?

@vancluever vancluever added the enhancement Type: Enhancement label May 10, 2018
@vancluever
Copy link
Contributor

@luis-silva thanks for your contribution! Everything looks good and I will be merging it momentarily.

For future reference, no, you don't need to tag or mention anyone for a PR to be reviewed - there's no prioritization system for this kind of thing. Sometimes PRs can take us a few days to get to though, depending on complexity and the current workload of maintainers.

Thanks again!

@vancluever vancluever merged commit d18f5ad into hashicorp:master May 10, 2018
@luis-silva
Copy link
Author

@vancluever Thank you for that, I wasn't expecting it to be merged that fast !
Just checking what the correct procedure was regarding contributing to this project, cheers.

@luis-silva luis-silva deleted the f-vsphere-disk-create-parents branch May 10, 2018 14:59
@ghost ghost locked and limited conversation to collaborators Apr 18, 2020
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
enhancement Type: Enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants