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

Add caching to go-template-utils

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • None
    • GRC
    • GRC Sprint 2023-17, GRC Sprint 2023-18
    • No

      When a user doesn't use object-templates-raw, they are forced to use multiple lookups of the same object if they need to reference different fields on the same object. This leads to an API request per lookup call.

      This is very expensive for Hub templates if you have 10 lookups on a policy applying to 100 clusters. That leads to 1000 API requests.

      Also, most hub templates refer to the same object, so we can reduce these queries by caching all looked up objects per root policy being processed. This would significantly cut down on API requests. This change would happen in go-template-utils and the policy propagator. Optionally, this new go-template-utils can be updated on the config-policy-controller for minor improvements there.

      Additionally, the go-template-utils library creates a dynamic client per `lookup` call. This should be created just once.

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

                Created:
                Updated:
                Resolved: