-
Notifications
You must be signed in to change notification settings - Fork 638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable codnition updaet when message change for custom plugin #238
enable codnition updaet when message change for custom plugin #238
Conversation
c6c7124
to
775441d
Compare
@@ -176,7 +176,7 @@ func (c *customPluginMonitor) generateStatus(result cpmtypes.Result) *types.Stat | |||
|
|||
condition.Status = status | |||
condition.Reason = result.Rule.Reason | |||
} else if condition.Status == status && condition.Reason != result.Rule.Reason { | |||
} else if condition.Status == status && (condition.Reason != result.Rule.Reason || (*c.config.PluginGlobalConfig.EnableMessageChangeBasedConditionUpdate && condition.Message != result.Message)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment on line 180 needs update.
Can you also update the custom plugin readme to include this new option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wangzhen127 Thanks for the tips. Will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wangzhen127 Done. PTAL.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is way too long... can we break it into 2 lines at some point?
775441d
to
840ba05
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a nit
@@ -176,7 +176,7 @@ func (c *customPluginMonitor) generateStatus(result cpmtypes.Result) *types.Stat | |||
|
|||
condition.Status = status | |||
condition.Reason = result.Rule.Reason | |||
} else if condition.Status == status && condition.Reason != result.Rule.Reason { | |||
} else if condition.Status == status && (condition.Reason != result.Rule.Reason || (*c.config.PluginGlobalConfig.EnableMessageChangeBasedConditionUpdate && condition.Message != result.Message)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is way too long... can we break it into 2 lines at some point?
840ba05
to
33dffe0
Compare
@Random-Liu Done. PTAL. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andyxning, Random-Liu The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Fix #200
This PR adds a custom global config to control whether NPD should update condition status when message changes.