Skip to content

Commit

Permalink
[smcontroller] Use SM LogStatus instead of hardcoded
Browse files Browse the repository at this point in the history
Signed-off-by: Mykola Kobets <[email protected]>
  • Loading branch information
mykola-kobets-epam authored and al1img committed Aug 28, 2024
1 parent 2e0df25 commit 9751ac3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions smcontroller/smcontroller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -815,14 +815,15 @@ func TestLogMessages(t *testing.T) {
ErrorInfo: &cloudprotocol.ErrorInfo{
Message: "this is error",
},
Status: "ok",
Status: cloudprotocol.LogStatusError,
}

smClient.sendMessageChannel <- &pbsm.SMOutgoingMessages{
SMOutgoingMessage: &pbsm.SMOutgoingMessages_Log{
Log: &pbsm.LogData{
LogId: "log0", PartCount: 2, Part: 1, Data: []byte("this is log"),
Error: &pbcommon.ErrorInfo{Message: "this is error"},
Error: &pbcommon.ErrorInfo{Message: "this is error"},
Status: cloudprotocol.LogStatusError,
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion smcontroller/smhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ func (handler *smHandler) processLogMessage(data *pb.LogData) {
ExitCode: int(data.GetError().GetExitCode()),
Message: data.GetError().GetMessage(),
},
Status: "ok",
Status: data.GetStatus(),
}); err != nil {
log.Errorf("Can't send log: %v", err)
}
Expand Down

0 comments on commit 9751ac3

Please sign in to comment.