Skip to content

Commit

Permalink
Add machine status info about import/migration event (#3632)
Browse files Browse the repository at this point in the history
* Add machine status info about import/migration event

This change notifies the user when a machine was created by flyd because
of a migration action.

It's a first iteration while a better solution is implemented in
nomad-firecracker.

* Display migrated instead of import
  • Loading branch information
aschiavo committed Jun 18, 2024
1 parent 37221f6 commit d618f10
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/command/machine/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ func runMachineStatus(ctx context.Context) (err error) {
exitEvent.ExitCode, exitEvent.OOMKilled, exitEvent.RequestedStop))
}

// This is terrible but will inform the users good enough while I build something
// elegant like the ExitEvent above
if event.Type == "launch" && event.Status == "created" && event.Source == "flyd" {
fields = append(fields, "migrated=true")
}

eventLogs = append(eventLogs, fields)
}
_ = render.Table(io.Out, "Event Logs", eventLogs, "State", "Event", "Source", "Timestamp", "Info")
Expand Down

0 comments on commit d618f10

Please sign in to comment.