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

vsphere.FilterVMsByX functions have inconsistent return values #863

Open
atc0005 opened this issue Jul 29, 2023 · 1 comment
Open

vsphere.FilterVMsByX functions have inconsistent return values #863

atc0005 opened this issue Jul 29, 2023 · 1 comment
Assignees
Milestone

Comments

@atc0005
Copy link
Owner

atc0005 commented Jul 29, 2023

Return values for these functions:

func FilterVMsByID(vms []mo.VirtualMachine, vmID string) (mo.VirtualMachine, int, error) {

func FilterVMsByName(vms []mo.VirtualMachine, vmName string) (mo.VirtualMachine, int, error) {

do not match the return values for similar functions:

func FilterVMsByCustomAttributeStatus(vms []VMWithCAs) ([]VMWithCAs, int) {

func FilterVMsByCustomAttributeNames(vmsWithCAs []VMWithCAs, caNames []string) ([]VMWithCAs, int) {

I need to consider the use case and adopt a consistent set of return values. Ideally the entire signature would be consistent across the functions to permit creation of a common interface for batch processing.

@atc0005 atc0005 added this to the Future milestone Jul 29, 2023
@atc0005 atc0005 self-assigned this Jul 29, 2023
@atc0005
Copy link
Owner Author

atc0005 commented Jul 29, 2023

Note to self: The problem is unlikely to be limited just to functions that filter VMs as I likely used those functions as templates for other vSphere objects (e.g., datastores, hosts).

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

No branches or pull requests

1 participant