Skip to content

refactor: enhance resource pool handling#665

Merged
tenthirtyam merged 1 commit intomainfrom
refactor/enhance-resource-pool-handling
Feb 26, 2026
Merged

refactor: enhance resource pool handling#665
tenthirtyam merged 1 commit intomainfrom
refactor/enhance-resource-pool-handling

Conversation

@tenthirtyam
Copy link
Copy Markdown
Collaborator

Summary

Enhances the FindResourcePool method to handle resource pool name input more robustly and adds comprehensive tests for these scenarios. The changes improve how resource pool paths are resolved, handle errors more gracefully, and ensure whitespace in names is managed correctly.

  • Updated FindResourcePool in resource_pool.go to trim whitespace from the name parameter and handle absolute, relative, and empty resource pool names, improving flexibility and correctness when resolving resource pool paths.
  • Added handling for cases where the resolved resource pool is nil and improved error messages for better debugging.
  • Improved error handling when failing to find the default resource pool or virtual app, returning more informative errors.
  • Added new test cases in resource_pool_test.go to cover empty names with host or cluster, relative and absolute paths, and whitespace trimming, ensuring the new logic is thoroughly validated.
  • Imported the strings package in resource_pool.go to support whitespace trimming and path processing.

Type

  • fix: Bug Fix
  • feat: Feature or Enhancement
  • docs: Documentation
  • refactor: Refactoring
  • chore: Build, Dependencies, Workflows, etc.
  • other: Other (Please describe.)

Breaking Changes?

  • Yes, there are breaking changes.
  • No, there are no breaking changes.

Tests

  • Tests have been added or updated.
  • Tests have been completed.

Output:

Documentation

  • Documentation has been added or updated.

Issue References

Resolves #657

Release Note

Additional Information

@tenthirtyam tenthirtyam added this to the v2.2.0 milestone Feb 23, 2026
@tenthirtyam tenthirtyam self-assigned this Feb 23, 2026
Copilot AI review requested due to automatic review settings February 23, 2026 03:57
@tenthirtyam tenthirtyam requested a review from a team as a code owner February 23, 2026 03:57
@tenthirtyam tenthirtyam added the refactor Refactor label Feb 23, 2026
@github-actions github-actions bot added needs-review Needs Review size/m Relative Sizing: Medium labels Feb 23, 2026

This comment was marked as resolved.

@tenthirtyam tenthirtyam force-pushed the refactor/enhance-resource-pool-handling branch 2 times, most recently from 04721c5 to c95569a Compare February 23, 2026 04:10
@tenthirtyam tenthirtyam requested a review from Copilot February 23, 2026 04:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@tenthirtyam tenthirtyam removed the needs-review Needs Review label Feb 23, 2026
Enhances the `FindResourcePool` method to handle resource pool name input more robustly and adds comprehensive tests for these scenarios. The changes improve how resource pool paths are resolved, handle errors more gracefully, and ensure whitespace in names is managed correctly.

Signed-off-by: Ryan Johnson <ryan@tenthirtyam.org>
@tenthirtyam tenthirtyam force-pushed the refactor/enhance-resource-pool-handling branch from c95569a to 08cac7f Compare February 24, 2026 03:03
@github-actions github-actions bot added the needs-review Needs Review label Feb 24, 2026
@tenthirtyam tenthirtyam merged commit a31f8c9 into main Feb 26, 2026
9 checks passed
@tenthirtyam tenthirtyam deleted the refactor/enhance-resource-pool-handling branch February 26, 2026 17:52
@tenthirtyam tenthirtyam removed the needs-review Needs Review label Mar 13, 2026
@github-actions
Copy link
Copy Markdown

This functionality has been released in v2.1.2 of the plugin.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactor size/m Relative Sizing: Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vsphere-iso: resource pool path handling can panic or fail with malformed lookup path

3 participants