Skip to content

Commit

Permalink
state flags as red alerts and cyan warnings
Browse files Browse the repository at this point in the history
* add helper for CLI (tbd) to use two respective colors
* prev. commit: c434fb6

Signed-off-by: Alex Aizman <[email protected]>
  • Loading branch information
alex-aizman committed Aug 23, 2024
1 parent cb4ea32 commit 1a8503f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmn/cos/node_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ func (f NodeStateFlags) IsRed() bool {
f.IsSet(NoMountpaths) || f.IsSet(NumGoroutines)
}

func (f NodeStateFlags) IsWarn() bool {
return f.IsSet(Rebalancing) || f.IsSet(RebalanceInterrupted) ||
f.IsSet(Resilvering) || f.IsSet(ResilverInterrupted) ||
f.IsSet(Restarted) || f.IsSet(MaintenanceMode) || f.IsSet(LowCapacity)
}

func (f NodeStateFlags) IsSet(flag NodeStateFlags) bool { return BitFlags(f).IsSet(BitFlags(flag)) }

func (f NodeStateFlags) Set(flags NodeStateFlags) NodeStateFlags {
Expand Down

0 comments on commit 1a8503f

Please sign in to comment.