-
Bug
-
Resolution: Done
-
Normal
-
ACM 2.13.0
-
2
-
False
-
None
-
False
-
-
-
GRC Sprint 2025-05
-
Low
-
None
Description of problem:
I can pass in a directory of resources used as input to the policy dryrun command. If that directory happens to contain an ACM Policy resource, I would think we could ignore or handle it nicely. Instead I get an error:
Error: the resource version was not found for kind Policy: if this is a custom resource, it may need an entry in the mappings file
Version-Release number of selected component (if applicable):
2.13.0-SNAPSHOT-2025-02-26-09-53-17
How reproducible:
Easy to reproduce
Steps to Reproduce:
- Start with a working dryrun scenario where the resources used are contained in a directory
- Copy a valid ACM Policy into your resources folder
- Run the same dryrun command that was previously working. The following error is returned:
Error: the resource version was not found for kind Policy: if this is a custom resource, it may need an entry in the mappings file
Actual results:
$ policytools dryrun -p policies/policy-limitmemory.yaml resources
- Diffs:
- Compliance messages:
NonCompliant; violation - namespaced object mem-limit-range of kind LimitRange has no namespace specified from the policy namespaceSelector nor the object metadata
Error: policy is NonCompliant
$ cp policies/policy-limitmemory.yaml resources/
$ policytools dryrun -p policies/policy-limitmemory.yaml resources
Error: the resource version was not found for kind Policy: if this is a custom resource, it may need an entry in the mappings fileExpected results:
The two dryrun commands above should have both worked I think