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

set specified inventory path in SearchIndex.FindByInventoryPath #3095

Closed
Syuparn opened this issue Apr 15, 2023 · 0 comments · Fixed by #3096
Closed

set specified inventory path in SearchIndex.FindByInventoryPath #3095

Syuparn opened this issue Apr 15, 2023 · 0 comments · Fixed by #3096

Comments

@Syuparn
Copy link
Contributor

Syuparn commented Apr 15, 2023

Is your feature request related to a problem? Please describe.
Objects fetched by SearchIndex.FindByInventoryPath does not have inventory path.

si := object.NewSearchIndex(c)
obj, _ := si.FindByInventoryPath(ctx, "/DC0/vm/DC0_H0_VM0")
vm := obj.(*object.VirtualMachine)

fmt.Printf("searchIndex: %q\n", vm.InventoryPath) // searchIndex: ""

Describe the solution you'd like
The returned object has the inventry path specified by arguments.

Additional context
Objects returned by find.Finder has the inventory path.

f := find.NewFinder(c)
vm, _ := f.VirtualMachine(ctx, "/DC0/vm/DC0_H0_VM0")
fmt.Printf("finder: %q\n", vm.InventoryPath) // finder: "/DC0/vm/DC0_H0_VM0"
Syuparn added a commit to Syuparn/govmomi that referenced this issue Apr 15, 2023
Closes: vmware#3095
Signed-off-by: syuparn <s.hello.spagetti@gmail.com>
dougm pushed a commit that referenced this issue Jun 27, 2023
Closes: #3095
Signed-off-by: syuparn <s.hello.spagetti@gmail.com>
priyanka19-98 pushed a commit to priyanka19-98/govmomi that referenced this issue Jan 17, 2024
Closes: vmware#3095
Signed-off-by: syuparn <s.hello.spagetti@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant