Bug 2042545

Summary: ACM configuration policies do not handle Limitrange or Quotas values
Product: Red Hat Advanced Cluster Management for Kubernetes Reporter: Felix Dewaleyne <fdewaley>
Component: GRC & PolicyAssignee: Will Kutler <wkutler>
Status: CLOSED ERRATA QA Contact: Derek Ho <dho>
Severity: low Docs Contact: Mikela Dockery <mdockery>
Priority: unspecified    
Version: rhacm-2.4CC: ecai, fdewaley, ycao56
Target Milestone: ---Flags: dho: qe_test_coverage+
bot-tracker-sync: rhacm-2.4.z+
Target Release: rhacm-2.4.2   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-03 07:00:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
policy example none

Description Felix Dewaleyne 2022-01-19 17:04:10 UTC
Created attachment 1851891 [details]
policy example

Description of problem:
ACM configuration policies do not handle Limitrange or Quotas values

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

How reproducible:
all the time

Steps to Reproduce:
1. create a policy like the sample one in additional info
2. apply it
3. make changes to the target on the cpu or memory limit

Actual results:
nothing happens

Expected results:
inform triggers as expected

Additional info:

sample policy
~~~
apiVersion: policy.open-cluster-management.io/v1
kind: Policy
metadata:
  name: limit-range
spec:
  remediationAction: inform
  disabled: false
  policy-templates:
    - objectDefinition:
        apiVersion: policy.open-cluster-management.io/v1
        kind: ConfigurationPolicy
        metadata:
          name: limit-range
        spec:
          remediationAction: inform
          severity: high
          namespaceSelector:
            exclude:
            - "openshift*"
            - "kube*"
            - "default"
            - "open-cluster*"
            - "ocp-gc-tgt-prepla"
            include: ["amqstreams-prod-bck"]
          object-templates:
            - complianceType: musthave
              objectDefinition:
                kind: LimitRange
                apiVersion: v1
                metadata:
                  name: amqstreams-prod-bck-limitrange
                spec:
                  limits:
                  - max:
                      cpu: "1"
                      memory: 2Gi
                    min:
                      cpu: 100m
                      memory: 128Mi
                    type: Pod
                  - default:
                      cpu: 500m
                      memory: 512Mi
                    defaultRequest:
                      cpu: 200m
                      memory: 256Mi
                    max:
                      cpu: "1"
                      memory: 1Gi
                    min:
                      cpu: 100m
                      memory: 128Mi
                    type: Container
~~~

Comment 3 Will Kutler 2022-01-21 14:55:07 UTC
*** Bug 2043526 has been marked as a duplicate of this bug. ***

Comment 12 errata-xmlrpc 2022-03-03 07:00:47 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Red Hat Advanced Cluster Management 2.4.2 security updates and bug fixes), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:0735