Set target uuid opposed to resource id

The uuid is the public identifier vs the resource id which should
be for internal operations.
The target uuid should correspond to the machine id (given by
the provider)
This commit is contained in:
sophia 2022-01-04 11:46:22 -06:00 committed by Paul Hinze
parent 90033b9b68
commit 9ea254735a
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
2 changed files with 2 additions and 2 deletions

View File

@ -244,7 +244,7 @@ func (m *Machine) SyncedFolders() (folders []*core.MachineSyncedFolder, err erro
func (m *Machine) SaveMachine() (err error) {
m.logger.Debug("saving machine to db", "machine", m.machine.Id)
m.target.Record, err = ptypes.MarshalAny(m.machine)
m.target.ResourceId = m.machine.Id
m.target.Uuid = m.machine.Id
if err != nil {
return nil
}

View File

@ -28,7 +28,7 @@ func TestMachineSetValidId(t *testing.T) {
if err != nil {
t.Errorf("Failed to get target")
}
require.Equal(t, dbTarget.Target.ResourceId, "something")
require.Equal(t, dbTarget.Target.Uuid, "something")
}
func TestMachineSetEmptyId(t *testing.T) {