from https://github.com/open-cluster-management-io/config-policy-controller/pull/95
Prerequisite: Start with what we have
This would probably go in the current doc for configuration policies - https://github.com/stolostron/rhacm-docs/blob/2.8_stage/governance/config_policy_ctrl.adoc#configuration-policy-yaml-table
Describe the changes in the doc and link to your dev story
Provide info for the following steps:
- Include the following:
spec.object-templates is now optional and we have added a new field, spec.object-templates-raw, that should be included in the documentation. This field is a string, rather than an array of objects, which allows users to paste in a YAML string for desired objects and the configuration policy controller will process it the same as the regular object-templates array. This is especially useful for policy templatization, as users can now use templates that span multiple lines of YAML. Note that while object-templates and object-templates-raw are optional, at least one of the two fields must be set.
Here is an example of the new field being used to create a config map:
```
apiVersion: policy.open-cluster-management.io/v1
kind: ConfigurationPolicy
metadata:
name: create-configmap
spec:
remediationAction: enforce
severity: low
object-templates-raw: |
- complianceType: musthave
objectDefinition:
apiVersion: v1
kind: ConfigMap
metadata:
name: myconfig
namespace: default
data:
testData: hello
```
1. - [ ] Mandatory Choose the documentation release (Published releases are refreshed ~weekly after publication).
- [ x]ACM 2.8 (upcoming release)
Mandatory: Choose the type of documentation change.
Update to an existing topic
Mandatory: Include a link to the file that needs to change. You can use a link from the repository or the Portal.
- is triggered by
-
ACM-2739 Support for Multiline YAML Values in Policy Templates
- Closed