Skip to content

Commit

Permalink
fix: esxi vm delete
Browse files Browse the repository at this point in the history
  • Loading branch information
ioito committed Oct 27, 2023
1 parent b82b6cc commit 1c7b564
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/multicloud/esxi/virtualmachine.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ func (svm *SVirtualMachine) Refresh() error {
var moObj mo.VirtualMachine
err := svm.manager.reference2Object(svm.object.Reference(), VIRTUAL_MACHINE_PROPS, &moObj)
if err != nil {
if e := errors.Cause(err); soap.IsSoapFault(e) {
_, ok := soap.ToSoapFault(e).VimFault().(types.ManagedObjectNotFound)
if ok {
return cloudprovider.ErrNotFound
}
}
return err
}
base.object = &moObj
Expand Down

0 comments on commit 1c7b564

Please sign in to comment.