Skip to content

Commit 3a81de3

Browse files
committed
log registrar errors in zui
1 parent 704f92a commit 3a81de3

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

cmds/modules/zui/header.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99

1010
"github.com/gizak/termui/v3/widgets"
1111
"github.com/pkg/errors"
12+
13+
"github.com/rs/zerolog/log"
1214
"github.com/threefoldtech/zbus"
1315
"github.com/threefoldtech/zos/pkg/app"
1416
"github.com/threefoldtech/zos/pkg/environment"
@@ -54,6 +56,14 @@ func headerRenderer(ctx context.Context, c zbus.Client, h *widgets.Paragraph, r
5456
}
5557

5658
go func() {
59+
registrarLable := "registrar"
60+
zui := stubs.NewZUIStub(c)
61+
62+
// empty out zui errors for registrar
63+
if zuiErr := zui.PushErrors(ctx, registrarLable, []string{}); zuiErr != nil {
64+
log.Info().Err(zuiErr).Send()
65+
}
66+
5767
farmID, _ := identity.FarmID(ctx)
5868
for version := range ch {
5969
var name string
@@ -69,15 +79,18 @@ func headerRenderer(ctx context.Context, c zbus.Client, h *widgets.Paragraph, r
6979
if isInProgressError(err) {
7080
nodeID = green(err.Error())
7181
} else {
72-
nodeID = red(err.Error())
82+
nodeID = red(fmt.Sprintf("%d (unregistered)", node))
83+
if zuiErr := zui.PushErrors(ctx, registrarLable, []string{err.Error()}); zuiErr != nil {
84+
log.Info().Err(zuiErr).Send()
85+
}
7386
}
7487
} else {
7588
nodeID = green(fmt.Sprint(node))
7689
}
7790

7891
cache := green("OK")
7992
if app.CheckFlag(app.LimitedCache) {
80-
cache = red("no disks detected, running on limited cache")
93+
cache = red("no ssd disks detected, running on hdd-only mode")
8194
} else if app.CheckFlag(app.ReadonlyCache) {
8295
cache = red("cache is read-only")
8396
}

0 commit comments

Comments
 (0)