-
Bug
-
Resolution: Done-Errata
-
Major
-
None
-
None
-
Product / Portfolio Work
-
2
-
False
-
-
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:
- 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:
- https://redhat-internal.slack.com/archives/CU4QXLPQB/p1741779901029179
- https://redhat-internal.slack.com/archives/CU4QXLPQB/p1740741159769869
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
- links to
-
RHSA-2025:147509 Red Hat Advanced Cluster Management 2.13.2 bug fixes and container updates
- mentioned on