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

Old objects left in ConfigurationPolicy after reducing number of templates

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • ACM 2.12.0
    • ACM 2.12.0
    • GRC
    • None
    • 1
    • False
    • Hide

      None

      Show
      None
    • 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:

      1. Create a ConfigurationPolicy with multiple object-templates.
      2. Observe the status.
      3. 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.

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

                Created:
                Updated:
                Resolved: