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

fix: r/vsphere_nas_datastore not mounted to additional hosts as day-two #1860

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

stoyan-hristov
Copy link
Contributor

@stoyan-hristov stoyan-hristov commented Mar 21, 2023

Fix a bug in nasDatastoreMountProcessor.diff() method which was the root cause of #1589

Description

Fix r/vsphere_nas_datastore not mounted to additional hosts as day-two.

The nasDatastoreMountProcessor.diff() method was not correctly calculating the difference between the old and the new datastore hosts and as a result of this the nasDatastoreMountProcessor.processMountOperations()was not mounting the datastore the new hosts.

Testing done:
Added additional ESXi hosts to the "host_system_ids" of NFS datastore and verified that terraform apply correctly mounted the datastore to the new hosts.

Closes #1589

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

% make testacc TESTARGS="-run='TestAccResourceVSphereNasDatastore'"
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run='TestAccResourceVSphereNasDatastore' -timeout 240m
?   	github.com/hashicorp/terraform-provider-vsphere	[no test files]
=== RUN   TestAccResourceVSphereNasDatastore_basic
--- PASS: TestAccResourceVSphereNasDatastore_basic (95.16s)
=== RUN   TestAccResourceVSphereNasDatastore_multiHost
--- PASS: TestAccResourceVSphereNasDatastore_multiHost (85.58s)
=== RUN   TestAccResourceVSphereNasDatastore_basicToMultiHost
--- PASS: TestAccResourceVSphereNasDatastore_basicToMultiHost (115.49s)
=== RUN   TestAccResourceVSphereNasDatastore_multiHostToBasic
--- PASS: TestAccResourceVSphereNasDatastore_multiHostToBasic (114.27s)
=== RUN   TestAccResourceVSphereNasDatastore_renameDatastore
--- PASS: TestAccResourceVSphereNasDatastore_renameDatastore (121.41s)
=== RUN   TestAccResourceVSphereNasDatastore_inFolder
--- PASS: TestAccResourceVSphereNasDatastore_inFolder (94.32s)
=== RUN   TestAccResourceVSphereNasDatastore_moveToFolder
--- PASS: TestAccResourceVSphereNasDatastore_moveToFolder (126.15s)
=== RUN   TestAccResourceVSphereNasDatastore_inDatastoreCluster
--- PASS: TestAccResourceVSphereNasDatastore_inDatastoreCluster (97.25s)
=== RUN   TestAccResourceVSphereNasDatastore_moveToDatastoreCluster
--- PASS: TestAccResourceVSphereNasDatastore_moveToDatastoreCluster (125.42s)
=== RUN   TestAccResourceVSphereNasDatastore_singleTag
--- PASS: TestAccResourceVSphereNasDatastore_singleTag (93.48s)
=== RUN   TestAccResourceVSphereNasDatastore_modifyTags
--- PASS: TestAccResourceVSphereNasDatastore_modifyTags (128.06s)
=== RUN   TestAccResourceVSphereNasDatastore_singleCustomAttribute
--- PASS: TestAccResourceVSphereNasDatastore_singleCustomAttribute (87.62s)
=== RUN   TestAccResourceVSphereNasDatastore_multiCustomAttribute
--- PASS: TestAccResourceVSphereNasDatastore_multiCustomAttribute (119.52s)
PASS
``

### Release Note
Release note for [CHANGELOG](https://github.com/hashicorp/terraform-provider-vsphere/blob/main/CHANGELOG.md):
Bug fix:

`r/vsphere_nas_datastore` not mounted to additional hosts as day-two https://github.com/hashicorp/terraform-provider-vsphere/issues/1589

### References

https://github.com/hashicorp/terraform-provider-vsphere/issues/1589

@stoyan-hristov stoyan-hristov requested a review from a team as a code owner March 21, 2023 12:44
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 21, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added provider Type: Provider size/xs Relative Sizing: Extra-Small labels Mar 21, 2023
Fix a bug in nasDatastoreMountProcessor.diff() method which was the root cause of hashicorp#1589
@tenthirtyam tenthirtyam added the area/storage Area: Storage label Mar 21, 2023
@tenthirtyam tenthirtyam changed the title fix: r/vsphere_nas_datastore not mounted to additional hosts as day-two fix: r/vsphere_nas_datastore not mounted to additional hosts as day-two Mar 21, 2023
@tenthirtyam tenthirtyam changed the title fix: r/vsphere_nas_datastore not mounted to additional hosts as day-two fix: r/vsphere_nas_datastore not mounted to additional hosts as day-two Mar 21, 2023
Copy link
Collaborator

@tenthirtyam tenthirtyam left a 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.

Sucessfully tested and approved. 🚀

@tenthirtyam tenthirtyam merged commit e5278a0 into hashicorp:main Mar 28, 2023
tenthirtyam pushed a commit that referenced this pull request Mar 28, 2023
Update `CHANGELOG.md` to include the bug fix in #1860 for #1589.

Signed-off-by: Ryan Johnson <johnsonryan@vmware.com>
@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 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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/storage Area: Storage provider Type: Provider size/xs Relative Sizing: Extra-Small
Projects
None yet
Development

Successfully merging this pull request may close these issues.

r/vsphere_nas_datastore not mounted to additional hosts as day-two
3 participants