Change TargetIndex to only search by uuid

Note this reverses a change made in
https://github.com/hashicorp/vagrant-ruby/pull/180 to attempt to address
issues losing track of machines. Further testing is in order to verify
we haven't re-broken that, but after discussion we agreed this is the
correct behavior for the index.
This commit is contained in:
Paul Hinze 2022-05-16 17:11:53 -05:00
parent 06350a7afc
commit 52ed086644
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0

View File

@ -47,15 +47,7 @@ func (t *TargetIndex) Get(uuid string) (entry core.Target, err error) {
},
})
if err != nil {
// Search name if not found by uuid
result, err = t.client.FindTarget(t.ctx, &vagrant_server.FindTargetRequest{
Target: &vagrant_server.Target{
Name: uuid,
},
})
if err != nil {
return
}
return
}
return t.loadTarget(&vagrant_plugin_sdk.Ref_Target{
ResourceId: result.Target.ResourceId,