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

ConfigurationPolicy may not always work with openshift template resources

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Major Major
    • ACM 2.14.0, ACM 2.13.2
    • None
    • GRC
    • None
    • Product / Portfolio Work
    • 2
    • False
    • Hide

      None

      Show
      None
    • False
    • GRC Sprint 2025-06
    • Moderate
    • None

      Description of problem:

      A ConfigurationPolicy that defines a template resource (kind: Template, apiVersion: 
      template.openshift.io/v1) may not function correctly. If evaluationInterval is used, it may repeatedly report non-compliant and the compliant (created). If evaluationInterval is not used, it may report compliant, but log an error watching the resource. In either case, the resource might not be created. 

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

      How reproducible:

      Unknown, seems inconsistent

      Steps to Reproduce:

      1. Create a ConfigurationPolicy that defines an openshift template.

      Actual results:

      The config-policy-controller sometimes uses the wrong API endpoint (.../processedtemplates/... instead of .../templates/...) because of how it chooses the GVR based on the GVK. As a result, it does not actually work with the correct resource.

      Expected results:

      It should work with the correct resource.

      Additional info:

      Two slack threads reported this:

      I believe I have seen users successfully define these templates in policies before, so this may be inconsistent behavior, possibly between openshift releases.

      The issue likely stems from the GVK to GVR mapping using the first matching resource it finds, there should be two and only one of them will "work": https://github.com/stolostron/kubernetes-dependency-watches/blob/6e0b4adee50e26786a2a3558dbc9b58b416051c5/client/cache.go#L311 

              jkulikau@redhat.com Justin Kulikauskas
              jkulikau@redhat.com Justin Kulikauskas
              Derek Ho Derek Ho
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: