Fix for Support selection of datastore for dynamic provisioning in vSphere
This commit is contained in:
committed by
Ritesh H Shukla
parent
b201ac2f8f
commit
12f75f0b86
35
vendor/github.com/vmware/govmomi/vim25/mo/ancestors.go
generated
vendored
35
vendor/github.com/vmware/govmomi/vim25/mo/ancestors.go
generated
vendored
@@ -17,11 +17,11 @@ limitations under the License.
|
||||
package mo
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/vmware/govmomi/vim25/soap"
|
||||
"github.com/vmware/govmomi/vim25/types"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// Ancestors returns the entire ancestry tree of a specified managed object.
|
||||
@@ -39,13 +39,28 @@ func Ancestors(ctx context.Context, rt soap.RoundTripper, pc, obj types.ManagedO
|
||||
&types.SelectionSpec{Name: "traverseParent"},
|
||||
},
|
||||
},
|
||||
&types.TraversalSpec{
|
||||
SelectionSpec: types.SelectionSpec{},
|
||||
Type: "VirtualMachine",
|
||||
Path: "parentVApp",
|
||||
Skip: types.NewBool(false),
|
||||
SelectSet: []types.BaseSelectionSpec{
|
||||
&types.SelectionSpec{Name: "traverseParent"},
|
||||
},
|
||||
},
|
||||
},
|
||||
Skip: types.NewBool(false),
|
||||
}
|
||||
|
||||
pspec := types.PropertySpec{
|
||||
Type: "ManagedEntity",
|
||||
PathSet: []string{"name", "parent"},
|
||||
pspec := []types.PropertySpec{
|
||||
{
|
||||
Type: "ManagedEntity",
|
||||
PathSet: []string{"name", "parent"},
|
||||
},
|
||||
{
|
||||
Type: "VirtualMachine",
|
||||
PathSet: []string{"parentVApp"},
|
||||
},
|
||||
}
|
||||
|
||||
req := types.RetrieveProperties{
|
||||
@@ -53,13 +68,12 @@ func Ancestors(ctx context.Context, rt soap.RoundTripper, pc, obj types.ManagedO
|
||||
SpecSet: []types.PropertyFilterSpec{
|
||||
{
|
||||
ObjectSet: []types.ObjectSpec{ospec},
|
||||
PropSet: []types.PropertySpec{pspec},
|
||||
PropSet: pspec,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
var ifaces []interface{}
|
||||
|
||||
err := RetrievePropertiesForRequest(ctx, rt, req, &ifaces)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -96,6 +110,15 @@ func Ancestors(ctx context.Context, rt soap.RoundTripper, pc, obj types.ManagedO
|
||||
}
|
||||
}
|
||||
|
||||
if me.Parent == nil {
|
||||
// Special case for VirtualMachine within VirtualApp,
|
||||
// unlikely to hit this other than via Finder.Element()
|
||||
switch x := iface.(type) {
|
||||
case VirtualMachine:
|
||||
me.Parent = x.ParentVApp
|
||||
}
|
||||
}
|
||||
|
||||
if me.Parent == nil {
|
||||
out = append(out, me)
|
||||
break
|
||||
|
||||
36
vendor/github.com/vmware/govmomi/vim25/mo/mo.go
generated
vendored
36
vendor/github.com/vmware/govmomi/vim25/mo/mo.go
generated
vendored
@@ -984,6 +984,18 @@ func init() {
|
||||
t["HttpNfcLease"] = reflect.TypeOf((*HttpNfcLease)(nil)).Elem()
|
||||
}
|
||||
|
||||
type InternalDynamicTypeManager struct {
|
||||
Self types.ManagedObjectReference
|
||||
}
|
||||
|
||||
func (m InternalDynamicTypeManager) Reference() types.ManagedObjectReference {
|
||||
return m.Self
|
||||
}
|
||||
|
||||
func init() {
|
||||
t["InternalDynamicTypeManager"] = reflect.TypeOf((*InternalDynamicTypeManager)(nil)).Elem()
|
||||
}
|
||||
|
||||
type InventoryView struct {
|
||||
ManagedObjectView
|
||||
}
|
||||
@@ -1290,6 +1302,18 @@ func init() {
|
||||
t["PropertyFilter"] = reflect.TypeOf((*PropertyFilter)(nil)).Elem()
|
||||
}
|
||||
|
||||
type ReflectManagedMethodExecuter struct {
|
||||
Self types.ManagedObjectReference
|
||||
}
|
||||
|
||||
func (m ReflectManagedMethodExecuter) Reference() types.ManagedObjectReference {
|
||||
return m.Self
|
||||
}
|
||||
|
||||
func init() {
|
||||
t["ReflectManagedMethodExecuter"] = reflect.TypeOf((*ReflectManagedMethodExecuter)(nil)).Elem()
|
||||
}
|
||||
|
||||
type ResourcePlanningManager struct {
|
||||
Self types.ManagedObjectReference
|
||||
}
|
||||
@@ -1496,18 +1520,6 @@ func init() {
|
||||
t["UserDirectory"] = reflect.TypeOf((*UserDirectory)(nil)).Elem()
|
||||
}
|
||||
|
||||
type VRPResourceManager struct {
|
||||
Self types.ManagedObjectReference
|
||||
}
|
||||
|
||||
func (m VRPResourceManager) Reference() types.ManagedObjectReference {
|
||||
return m.Self
|
||||
}
|
||||
|
||||
func init() {
|
||||
t["VRPResourceManager"] = reflect.TypeOf((*VRPResourceManager)(nil)).Elem()
|
||||
}
|
||||
|
||||
type View struct {
|
||||
Self types.ManagedObjectReference
|
||||
}
|
||||
|
||||
2
vendor/github.com/vmware/govmomi/vim25/mo/retrieve.go
generated
vendored
2
vendor/github.com/vmware/govmomi/vim25/mo/retrieve.go
generated
vendored
@@ -17,12 +17,12 @@ limitations under the License.
|
||||
package mo
|
||||
|
||||
import (
|
||||
"context"
|
||||
"reflect"
|
||||
|
||||
"github.com/vmware/govmomi/vim25/methods"
|
||||
"github.com/vmware/govmomi/vim25/soap"
|
||||
"github.com/vmware/govmomi/vim25/types"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
func ignoreMissingProperty(ref types.ManagedObjectReference, p types.MissingProperty) bool {
|
||||
|
||||
Reference in New Issue
Block a user