Skip to content

Commit

Permalink
Merge pull request kubernetes#455 from ZYecho/fix_newmessage
Browse files Browse the repository at this point in the history
fix: print result's message when status unknown
  • Loading branch information
k8s-ci-robot authored Nov 25, 2020
2 parents 6956e60 + b51cb32 commit 1e917af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/custompluginmonitor/custom_plugin_monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,10 @@ func (c *customPluginMonitor) generateStatus(result cpmtypes.Result) *types.Stat
if condition.Status == types.True && status != types.True {
// Scenario 1: Condition status changes from True to False/Unknown
newReason = defaultConditionReason
if newMessage == "" {
if status == types.False {
newMessage = defaultConditionMessage
} else {
// When status unknown, the result's message is important for debug
newMessage = result.Message
}
} else if condition.Status != types.True && status == types.True {
Expand All @@ -200,9 +201,10 @@ func (c *customPluginMonitor) generateStatus(result cpmtypes.Result) *types.Stat
} else if condition.Status != status {
// Scenario 3: Condition status changes from False to Unknown or vice versa
newReason = defaultConditionReason
if newMessage == "" {
if status == types.False {
newMessage = defaultConditionMessage
} else {
// When status unknown, the result's message is important for debug
newMessage = result.Message
}
} else if condition.Status == types.True && status == types.True &&
Expand Down

0 comments on commit 1e917af

Please sign in to comment.