Skip to content

Commit

Permalink
cli: needToReboot in status
Browse files Browse the repository at this point in the history
  • Loading branch information
nlewo committed Aug 19, 2024
1 parent 2815fef commit 5bb76fd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ var statusCmd = &cobra.Command{
logrus.Fatal(err)
}
fmt.Printf("Status of the machine %s\n", status.Hostname)
needToReboot := "no"
if status.NeedToReboot {
needToReboot = "yes"
}
fmt.Printf(" Need to reboot: %s\n", needToReboot)
for _, r := range status.RepositoryStatus.Remotes {
fmt.Printf(" Remote %s fetched %s\n",
r.Url, humanize.Time(r.FetchedAt),
Expand Down
2 changes: 2 additions & 0 deletions internal/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type State struct {
IsRunning bool `json:"is_running"`
Deployment deployment.Deployment `json:"deployment"`
Hostname string `json:"hostname"`
NeedToReboot bool `json:"need_to_reboot"`
}

type Manager struct {
Expand Down Expand Up @@ -108,6 +109,7 @@ func (m Manager) toState() State {
IsRunning: m.isRunning,
Deployment: m.deployment,
Hostname: m.hostname,
NeedToReboot: m.needToReboot,
}
}

Expand Down

0 comments on commit 5bb76fd

Please sign in to comment.