mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-25 19:05:13 +00:00
Update vmware/govmomi vendor: add vapi package
Zones implementation for vSphere cloud provider needs dependencies which are not included in current vmware/govmomi vendor. So this update added "vapi" package to support zones.
This commit is contained in:
22
vendor/github.com/vmware/govmomi/simulator/search_index.go
generated
vendored
22
vendor/github.com/vmware/govmomi/simulator/search_index.go
generated
vendored
@@ -57,15 +57,18 @@ func (s *SearchIndex) FindByDatastorePath(r *types.FindByDatastorePath) soap.Has
|
||||
func (s *SearchIndex) FindByInventoryPath(req *types.FindByInventoryPath) soap.HasFault {
|
||||
body := &methods.FindByInventoryPathBody{Res: new(types.FindByInventoryPathResponse)}
|
||||
|
||||
path := strings.Split(req.InventoryPath, "/")
|
||||
if len(path) <= 1 {
|
||||
split := func(c rune) bool {
|
||||
return c == '/'
|
||||
}
|
||||
path := strings.FieldsFunc(req.InventoryPath, split)
|
||||
if len(path) < 1 {
|
||||
return body
|
||||
}
|
||||
|
||||
root := Map.content().RootFolder
|
||||
o := &root
|
||||
|
||||
for _, name := range path[1:] {
|
||||
for _, name := range path {
|
||||
f := s.FindChild(&types.FindChild{Entity: *o, Name: name})
|
||||
|
||||
o = f.(*methods.FindChildBody).Res.Returnval
|
||||
@@ -132,9 +135,16 @@ func (s *SearchIndex) FindByUuid(req *types.FindByUuid) soap.HasFault {
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
if vm.Config.Uuid == req.Uuid {
|
||||
body.Res.Returnval = &ref
|
||||
break
|
||||
if req.InstanceUuid != nil && *req.InstanceUuid {
|
||||
if vm.Config.InstanceUuid == req.Uuid {
|
||||
body.Res.Returnval = &ref
|
||||
break
|
||||
}
|
||||
} else {
|
||||
if vm.Config.Uuid == req.Uuid {
|
||||
body.Res.Returnval = &ref
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user