-
Bug
-
Resolution: Done
-
Major
-
ACM 2.12.0
-
None
-
1
-
False
-
-
False
-
-
-
GRC Sprint 2024-19
-
Moderate
-
None
Description of problem:
When the number of `object-templates` in a ConfigurationPolicy is reduced, either by editing the policy, or as a result of cluster-state changes used in `object-templates-raw`, old objects may remain in the status and compliance messages from the ConfigruationPolicy.
Version-Release number of selected component (if applicable):
Only the current in-development version.
How reproducible:
100%
Steps to Reproduce:
- Create a ConfigurationPolicy with multiple object-templates.
- Observe the status.
- Edit the ConfigurationPolicy to reduce the number of object-templates.
For example:
apiVersion: policy.open-cluster-management.io/v1 kind: ConfigurationPolicy metadata: name: multi-namespace-objects spec: object-templates: - complianceType: musthave objectDefinition: apiVersion: v1 kind: Namespace metadata: name: open-cluster-management - complianceType: musthave objectDefinition: apiVersion: v1 kind: Namespace metadata: name: open-cluster-management-hub - complianceType: musthave objectDefinition: apiVersion: v1 kind: Namespace metadata: name: open-cluster-management-agent - complianceType: musthave objectDefinition: apiVersion: v1 kind: Namespace metadata: name: open-cluster-management-agent-addon remediationAction: inform severity: low
results in a message like "
notification - namespaces [open-cluster-management] found as specified; notification - namespaces [open-cluster-management-hub] found as specified; notification - namespaces [open-cluster-management-agent] found as specified; notification - namespaces [open-cluster-management-agent-addon] found as specified".
After editing it to only have:
object-templates: - complianceType: musthave objectDefinition: apiVersion: v1 kind: Namespace metadata: name: open-cluster-management-agent - complianceType: musthave objectDefinition: apiVersion: v1 kind: Namespace metadata: name: open-cluster-management-agent-addon remediationAction: inform severity: low
The message is: "
notification - namespaces [open-cluster-management-agent] found as specified; notification - namespaces [open-cluster-management-agent-addon] found as specified; notification - namespaces [open-cluster-management-agent] found as specified; notification - namespaces [open-cluster-management-agent-addon] found as specified".
Actual results:
see above
Expected results:
The new message should be "notification - namespaces [open-cluster-management-agent] found as specified; notification - namespaces [open-cluster-management-agent-addon] found as specified"
Additional info:
It seems this was previously fixed, but it returned when we moved to event-driven mode.