-
Notifications
You must be signed in to change notification settings - Fork 19
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
Bug: ConfigurationPolicy
message for enforce
omits objects when multiple namespaces are specified
#116
Conversation
5ed7ddc
to
a054076
Compare
2889e6a
to
47a83e1
Compare
d7e709f
to
aed9a71
Compare
aed9a71
to
2bdbd97
Compare
if statusUpdateNeeded { | ||
parentStatusUpdateNeeded = true | ||
} | ||
|
||
if mergeMessageEnforce { | ||
r.Recorder.Event(&plc, eventNormal, fmt.Sprintf(plcFmtStr, plc.GetName()), |
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.
Is this correct sending event? is this message will attach to policy history? curious
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.
I don't think this event sending is necessary? Does it work without this block? It's buried code, but (assuming I'm looking at this right) statusUpdateNeeded
propagates down the following function calls, and sendComplianceEvent
is the one that finally defines an Event and calls r.Create()
to deliver it:
checkRelatedAndUpdate
func (r *ConfigurationPolicyReconciler) checkRelatedAndUpdate( addForUpdate
func (r *ConfigurationPolicyReconciler) addForUpdate(policy *policyv1.ConfigurationPolicy, sendEvent bool) { updatePolicyStatus
func (r *ConfigurationPolicyReconciler) updatePolicyStatus( sendComplianceEvent
func (r *ConfigurationPolicyReconciler) sendComplianceEvent(instance *policyv1.ConfigurationPolicy) error {
2bdbd97
to
987e512
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.
Thanks! This will be a great update! I've left some comments/questions to consider.
if statusUpdateNeeded { | ||
parentStatusUpdateNeeded = true | ||
} | ||
|
||
if mergeMessageEnforce { | ||
r.Recorder.Event(&plc, eventNormal, fmt.Sprintf(plcFmtStr, plc.GetName()), |
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.
I don't think this event sending is necessary? Does it work without this block? It's buried code, but (assuming I'm looking at this right) statusUpdateNeeded
propagates down the following function calls, and sendComplianceEvent
is the one that finally defines an Event and calls r.Create()
to deliver it:
checkRelatedAndUpdate
func (r *ConfigurationPolicyReconciler) checkRelatedAndUpdate( addForUpdate
func (r *ConfigurationPolicyReconciler) addForUpdate(policy *policyv1.ConfigurationPolicy, sendEvent bool) { updatePolicyStatus
func (r *ConfigurationPolicyReconciler) updatePolicyStatus( sendComplianceEvent
func (r *ConfigurationPolicyReconciler) sendComplianceEvent(instance *policyv1.ConfigurationPolicy) error {
4dd9ba5
to
fe41032
Compare
ConfigurationPolicy message for enforce omits objects when multiple namespaces are specified When set to inform, the full list of objects is shown. But when set to enforce (the first two messages displayed), only the last object message is shown. In multiple namespaces, the message should be merged. Should be fixed like this example: pod [pod1] in namespace test1 found; [pod1] in namespace test2 found as specified, therefore this Object template is compliant Ref: https://issues.redhat.com/browse/ACM-2604 Signed-off-by: Yi Rae Kim <yikim@redhat.com>
fe41032
to
3aab88b
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.
/hold if others would like another review
LGTM! The existing code that used name == nil
as a signal that it had been "handled" is making my head spin, but you solution appears to work alongside it well. Thanks for the update!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dhaiducek, JustinKuli, yiraeChristineKim 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 |
/unhold |
/hold |
/unhold |
…ement-io#116) ConfigurationPolicy message for enforce omits objects when multiple namespaces are specified When set to inform, the full list of objects is shown. But when set to enforce (the first two messages displayed), only the last object message is shown. In multiple namespaces, the message should be merged. Should be fixed like this example: pod [pod1] in namespace test1 found; [pod1] in namespace test2 found as specified, therefore this Object template is compliant Ref: https://issues.redhat.com/browse/ACM-2604 Signed-off-by: Yi Rae Kim <yikim@redhat.com> (cherry picked from commit 48f6ec2)
ConfigurationPolicy message for enforce omits objects when multiple namespaces are specified
When set to inform, the full list of objects is shown. But when set to enforce (the first two messages displayed), only the last object message is shown. In multiple namespaces, the message should be merged.
Should be fixed like this example:
pod [pod1] in namespace test1 found; [pod1] in namespace test2 found as specified, therefore this Object template is compliant
Ref: https://issues.redhat.com/browse/ACM-2604