Uploaded image for project: 'Red Hat Advanced Cluster Management'
  1. Red Hat Advanced Cluster Management
  2. ACM-10403

Reduce policy template sync controller log noise

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • ACM 2.8.6
    • ACM 2.8.4
    • GRC
    • None
    • 1
    • False
    • None
    • False
    • GRC Sprint 2024-06
    • Moderate
    • No

      Description of problem:

      The template sync controller reconciles every time a policy template is updated. The config-policy-controller updates the `lastEvaluated` status on the ConfigurationPolicy, which by default is every 10 seconds. This can get noisy if you have a lot of policy templates and can cause important logs to be lost when debugging an issue since the logs rollover at a certain point.

      Logs such as this are not useful and instead, we should only log when something changes or is unexpected:

      ```
      024-03-07T19:32:32.713106056Z 2024-03-07T19:32:32.713Z info policy-template-sync templatesync/template_sync.go:98 Reconciling the Policy

      {"Request.Namespace": "cluster", "Request.Name": "open-cluster-management.policy"}

      2024-03-07T19:32:32.717219357Z 2024-03-07T19:32:32.717Z info policy-template-sync templatesync/template_sync.go:805 Existing object matches the policy template

      {"Request.Namespace": "cluster", "Request.Name": "open-cluster-management.policy", "template": "policy"}

      2024-03-07T19:32:32.720587809Z 2024-03-07T19:32:32.720Z info policy-template-sync templatesync/template_sync.go:805 Existing object matches the policy template

      {"Request.Namespace": "cluster", "Request.Name": "open-cluster-management.policy", "template": "policy"}

      2024-03-07T19:32:32.723474962Z 2024-03-07T19:32:32.723Z info policy-template-sync templatesync/template_sync.go:805 Existing object matches the policy template

      {"Request.Namespace": "cluster", "Request.Name": "open-cluster-management.policy", "template": "policy"}

      2024-03-07T19:32:32.741347887Z 2024-03-07T19:32:32.741Z info policy-template-sync templatesync/template_sync.go:875 Completed the reconciliation

      {"Request.Namespace": "cluster", "Request.Name": "open-cluster-management.policy"}

      ```

      Version-Release number of selected component (if applicable):

      2.8.4

      How reproducible:

      Steps to Reproduce:

      1. ...

      Actual results:

      Expected results:

      Additional info:

            mprahl Matthew Prahl
            mprahl Matthew Prahl
            Derek Ho Derek Ho
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: