mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
switch orbit enroll logic to use osquery_host_id (#7984)
This commit is contained in:
parent
2eb24b974a
commit
cfb3c7ae9f
1 changed files with 2 additions and 2 deletions
|
|
@ -849,10 +849,10 @@ func (ds *Datastore) EnrollOrbit(ctx context.Context, hardwareUUID string, orbit
|
|||
|
||||
var host fleet.Host
|
||||
err := ds.withRetryTxx(ctx, func(tx sqlx.ExtContext) error {
|
||||
err := sqlx.GetContext(ctx, tx, &host, `SELECT id FROM hosts WHERE uuid = ?`, hardwareUUID)
|
||||
err := sqlx.GetContext(ctx, tx, &host, `SELECT id FROM hosts WHERE osquery_host_id = ?`, hardwareUUID)
|
||||
switch {
|
||||
case err == nil:
|
||||
sqlUpdate := `UPDATE hosts SET orbit_node_key = ? WHERE uuid = ? `
|
||||
sqlUpdate := `UPDATE hosts SET orbit_node_key = ? WHERE osquery_host_id = ? `
|
||||
_, err := tx.ExecContext(ctx, sqlUpdate, orbitNodeKey, hardwareUUID)
|
||||
if err != nil {
|
||||
return ctxerr.Wrap(ctx, err, "orbit enroll error updating host details")
|
||||
|
|
|
|||
Loading…
Reference in a new issue