Skip to content

Commit

Permalink
Do not forget to report error severity
Browse files Browse the repository at this point in the history
For network connectivity testing and IO bundle processing,
we do not really use different error severity levels at the moment.
For any encountered issue we simply report an error message up to
zedagent and further to the controller. However, zedagent forgets
to set the severity to "error" and leaves it as unspecified.
This may have unwanted effect on how the error message is
treated/displayed by the controller.

Later, we could improve this and use different severity levels also
for connectivity testing. For example, longer the port connectivity
is down, the more severe the error reported would be.

Signed-off-by: Milan Lenco <milan@zededa.com>
  • Loading branch information
milan-zededa committed Apr 4, 2024
1 parent 8ff4729 commit 9556acf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/pillar/cmd/zedagent/handlemetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func encodeTestResults(tr types.TestResults) *info.ErrorInfo {
if tr.HasError() {
timestamp = tr.LastFailed
errInfo.Description = tr.LastError
errInfo.Severity = info.Severity_SEVERITY_ERROR
} else {
timestamp = tr.LastSucceeded
}
Expand Down
1 change: 1 addition & 0 deletions pkg/pillar/cmd/zedagent/handlenetworkinstance.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ func prepareAndPublishNetworkInstanceInfoMsg(ctx *zedagentContext,
errInfo.Description = status.Error
errTime, _ := ptypes.TimestampProto(status.ErrorTime)
errInfo.Timestamp = errTime
errInfo.Severity = zinfo.Severity(status.ErrorSeverity)
info.NetworkErr = append(info.NetworkErr, errInfo)
info.State = zinfo.ZNetworkInstanceState_ZNETINST_STATE_ERROR
} else if status.ChangeInProgress != types.ChangeInProgressTypeNone {
Expand Down
1 change: 1 addition & 0 deletions pkg/pillar/cmd/zedagent/reportinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ func PublishDeviceInfoToZedCloud(ctx *zedagentContext, dest destinationBitset) {
if ib.Error != "" {
errInfo := new(info.ErrorInfo)
errInfo.Description = ib.Error
errInfo.Severity = info.Severity_SEVERITY_ERROR
if !ib.ErrorTime.IsZero() {
protoTime, err := ptypes.TimestampProto(ib.ErrorTime)
if err == nil {
Expand Down

0 comments on commit 9556acf

Please sign in to comment.