-
Bug
-
Resolution: Done
-
Critical
-
ACM 2.13.0
-
1
-
False
-
None
-
False
-
-
-
GRC Sprint 2025-05
-
Low
-
None
Description of problem:
When creating the resource content for the dryrun command, if I grab the pod data from the cluster and save in a yaml file, I get the following error when I run the dryrun command:
Error: resourceVersion can not be set for Create requests
Version-Release number of selected component (if applicable):
2.13.0-SNAPSHOT-2025-02-24-05-54-38
How reproducible:
Always I think
Steps to Reproduce:
- For a running pod, capture the pod details with oc get po sample-nginx-pod -o yaml > pod.yaml
- Using the policy https://github.com/open-cluster-management-io/policy-collection/blob/main/stable/CM-Configuration-Management/policy-pod.yaml
- Run dryrun with a command like: policytools dryrun -p policies/policy-pod.yaml resources/pod.yaml
- I get the error: "Error: resourceVersion can not be set for Create requests"
Actual results:
Error mentioned above
Expected results:
I expected to get Policy analysis in the form of a Diff and Compliant or NonCompliant
Additional info:
The workaround is to remove the metadata entry from the pods.yaml resource that looks like:
resourceVersion: "618991"